/* IceBlue UI redesign v93 — Home / Add Customer / Day Book */

:root {
  --ib-blue: #1565C0;
  --ib-blue-dark: #0D47A1;
  --ib-green-soft: #E8F5E9;
  --ib-red-soft: #FFEBEE;
  --ib-blue-soft: #E3F2FD;
  --ib-orange-soft: #FFF3E0;
  --ib-purple-soft: #F3E5F5;
  --ib-yellow: #FB8C00;
}

/* Hide legacy chrome on redesign screens */
.work-bar { display: none !important; }
#app { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.top-header { display: none; }

/* ——— Page header (solid blue) ——— */
.page-header {
  background: var(--ib-blue);
  color: #fff;
  padding: 12px 16px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 64px;
}
.page-header .ph-back {
  border: none; background: transparent; color: #fff;
  font-size: 22px; line-height: 1; padding: 4px 6px 0 0; cursor: pointer;
  flex-shrink: 0;
}
.page-header .ph-text { flex: 1; min-width: 0; }
.page-header .ph-title {
  margin: 0; font-size: 18px; font-weight: 800; letter-spacing: 0.01em;
}
.page-header .ph-sub {
  margin: 2px 0 0; font-size: 12px; font-weight: 500; opacity: 0.88;
}
.page-header .ph-right {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 13px; font-weight: 600;
}
.page-header .ph-icon-btn {
  border: 1.5px solid rgba(255,255,255,.85); background: transparent;
  color: #fff; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.page-header .ph-bell { position: relative; }
.page-header .ph-badge {
  position: absolute; top: -4px; right: -4px;
  background: #E53935; color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 3px;
}
.page-header.center-title { justify-content: space-between; }
.page-header.center-title .ph-text { text-align: center; }

/* ——— Home Good Morning ——— */
.home-pad { padding: 12px 14px 20px; }
.home-orders-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--ib-blue); color: #fff;
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
  border: none; width: 100%; text-align: left; cursor: pointer;
  font-family: inherit;
}
.home-orders-banner .hob-num {
  font-size: 28px; font-weight: 800; margin-left: auto;
}
.home-orders-banner strong { display: block; font-size: 15px; }
.home-orders-banner span { font-size: 12px; opacity: 0.9; font-weight: 500; }
.home-orders-banner[hidden] { display: none !important; }

.home-stats-2x2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.home-stat {
  background: #fff; border-radius: 14px; padding: 12px;
  box-shadow: 0 2px 8px rgba(21,101,192,.08); border: 1px solid #e8eef5;
}
.home-stat .hs-l { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.home-stat .hs-v { font-size: 22px; font-weight: 800; color: var(--ib-blue); margin-top: 4px; }
.home-stat .hs-s { font-size: 11px; font-weight: 600; margin-top: 4px; color: #64748b; }
.home-stat .hs-s .g { color: #2E7D32; }
.home-stat .hs-s .o { color: #E65100; }
.home-stat.cash .hs-v { color: #2E7D32; }
.home-stat.credit .hs-v { color: #C62828; }

.home-coupons {
  display: flex; align-items: center; gap: 12px;
  background: var(--ib-orange-soft); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 12px;
}
.home-coupons .hc-n { font-size: 24px; font-weight: 800; color: #E65100; margin-left: auto; }

.home-progress { margin-bottom: 14px; }
.home-progress .hp-title { font-size: 14px; font-weight: 800; color: #1a1c1e; }
.home-progress .hp-sub { font-size: 12px; color: #64748b; font-weight: 600; margin: 4px 0 8px; }
.home-progress .hp-bar {
  height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
}
.home-progress .hp-fill {
  height: 100%; background: #43A047; border-radius: 999px; width: 0%;
  transition: width .3s ease;
}

.home-qa-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  margin-bottom: 14px;
}
.home-qa {
  border: none; background: #fff; border-radius: 14px;
  padding: 10px 4px; cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,.05); border: 1px solid #e8eef5;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.home-qa .qa-icon {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--ib-blue); color: #fff;
  display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.home-qa .qa-l { font-size: 9px; font-weight: 700; color: #475569; text-align: center; line-height: 1.2; }

.home-block { margin-bottom: 14px; }
.home-block .hb-title { font-size: 14px; font-weight: 800; }
.home-block .hb-sub { font-size: 12px; color: #64748b; font-weight: 600; margin: 2px 0 8px; }
.home-start-route {
  width: 100%; border: none; border-radius: 14px;
  background: var(--ib-yellow); color: #fff;
  font-size: 16px; font-weight: 800; padding: 14px; cursor: pointer;
  font-family: inherit;
}
.home-end-card {
  background: var(--ib-purple-soft); border-radius: 14px; padding: 14px;
  margin-bottom: 14px;
}
.home-end-card p { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #6A1B9A; }
.home-end-btn {
  width: 100%; border: none; border-radius: 12px;
  background: #7B1FA2; color: #fff; font-weight: 800; padding: 12px;
  cursor: pointer; font-family: inherit; font-size: 14px;
}

.home-upcoming .hu-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.home-upcoming .hu-head strong { font-size: 14px; }
.home-upcoming .hu-head button {
  border: none; background: none; color: var(--ib-blue);
  font-weight: 700; font-size: 12px; cursor: pointer; font-family: inherit;
}
.hu-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid #e8eef5;
  background: none; border-left: none; border-right: none; border-top: none;
  width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.hu-row .hu-no {
  width: 28px; height: 28px; border-radius: 999px; background: var(--ib-blue-soft);
  color: var(--ib-blue); font-weight: 800; font-size: 12px;
  display: grid; place-items: center; flex-shrink: 0;
}
.hu-row .hu-body { flex: 1; min-width: 0; }
.hu-row .hu-name { font-weight: 700; font-size: 14px; color: #1a1c1e; }
.hu-row .hu-meta { font-size: 12px; color: #64748b; font-weight: 600; }
.hu-row .hu-chev { color: #94a3b8; font-weight: 800; }

/* ——— Add Customer form ——— */
.screen-form .form-scroll { padding: 0; }
.add-form-v93 { padding: 14px 14px 100px; background: #fff; min-height: 50vh; }
.af-field {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 16px;
}
.af-ico {
  width: 28px; flex-shrink: 0; margin-top: 28px;
  color: var(--ib-blue); font-size: 18px; text-align: center;
}
.af-body { flex: 1; min-width: 0; }
.af-body label {
  display: block; font-size: 12px; font-weight: 700; color: #334155;
  margin-bottom: 6px;
}
.af-body input, .af-body select, .af-body textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #cbd5e1; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit;
  background: #fff; color: #1a1c1e;
}
.af-body textarea { min-height: 88px; resize: vertical; }
.af-hint { font-size: 11px; color: #94a3b8; font-weight: 600; margin: 4px 0 0; }
.af-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.af-row2 .af-field { margin-bottom: 0; }
.af-loc-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 4px 0;
}
.af-loc-row .af-ico { margin-top: 0; }
.af-loc-label { flex: 1; font-weight: 700; font-size: 14px; color: #334155; }
.af-save-loc {
  border: 1.5px solid var(--ib-blue); background: #fff; color: var(--ib-blue);
  border-radius: 12px; padding: 8px 12px; font-weight: 700; font-size: 12px;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.af-status-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.af-radio {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.af-radio input { accent-color: var(--ib-blue); width: 18px; height: 18px; }
.af-map-wrap {
  margin: 0 0 12px 38px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.af-map-wrap .loc-map { height: 160px !important; min-height: 160px !important; max-height: 160px !important; }
.af-map-wrap .loc-preview { font-size: 12px; padding: 8px; color: #64748b; }
.add-form-actions {
  position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 10px 14px; background: #fff;
  border-top: 1px solid #e2e8f0; z-index: 40;
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.add-form-actions .btn-cancel {
  border: 1.5px solid var(--ib-blue); background: #fff; color: var(--ib-blue);
  border-radius: 12px; padding: 14px; font-weight: 800; font-size: 15px;
  cursor: pointer; font-family: inherit;
}
.add-form-actions .btn-save {
  border: none; background: var(--ib-blue); color: #fff;
  border-radius: 12px; padding: 14px; font-weight: 800; font-size: 15px;
  cursor: pointer; font-family: inherit;
}
.add-form-actions .btn-save:disabled { opacity: 0.45; cursor: not-allowed; }

/* ——— Day Book ——— */
.db-pad { padding: 12px 12px 20px; }
.db-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 12px;
}
.db-metric {
  border-radius: 12px; padding: 10px 6px; text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.db-metric.inc { background: var(--ib-green-soft); }
.db-metric.exp { background: var(--ib-red-soft); }
.db-metric.profit { background: var(--ib-green-soft); }
.db-metric.bot { background: var(--ib-blue-soft); }
.db-metric .dm-l { font-size: 9px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.db-metric .dm-v { font-size: 14px; font-weight: 800; margin: 4px 0 2px; color: #1a1c1e; line-height: 1.15; }
.db-metric .dm-s { font-size: 8px; font-weight: 600; color: #94a3b8; line-height: 1.2; }

.db-overview {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: #fff; border-radius: 14px; padding: 12px 6px;
  margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid #e8eef5;
}
.db-ov { text-align: center; }
.db-ov .do-n { font-size: 16px; font-weight: 800; color: #1a1c1e; }
.db-ov .do-l { font-size: 9px; font-weight: 700; color: #64748b; }

.db-tx-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.db-tx-head strong { font-size: 14px; }
.db-tx-head button {
  border: none; background: none; color: var(--ib-blue);
  font-weight: 800; font-size: 13px; cursor: pointer; font-family: inherit;
}
.db-tx-list { margin-bottom: 12px; }
.db-tx-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 6px 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  align-items: start;
}
.db-tx-row .t-time { font-weight: 700; color: #64748b; font-variant-numeric: tabular-nums; }
.db-tx-row .t-name { font-weight: 700; color: #1a1c1e; }
.db-tx-row .t-meta { color: #64748b; font-weight: 600; margin-top: 2px; }
.db-tx-row .t-amt { font-weight: 800; text-align: right; white-space: nowrap; }
.db-tx-row .t-amt.neg { color: #C62828; }
.db-tx-row .t-amt.pos { color: #2E7D32; }
.badge-del {
  display: inline-block; background: #43A047; color: #fff;
  font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 999px;
}
.badge-exp {
  display: inline-block; background: #E53935; color: #fff;
  font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 999px;
}

.db-cash-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
  margin-bottom: 12px;
}
.db-cash {
  border-radius: 12px; padding: 10px 6px; text-align: center;
}
.db-cash.start { background: var(--ib-green-soft); }
.db-cash.end { background: var(--ib-red-soft); }
.db-cash.next { background: var(--ib-blue-soft); }
.db-cash .dc-l { font-size: 9px; font-weight: 700; color: #64748b; }
.db-cash .dc-v { font-size: 12px; font-weight: 800; margin-top: 4px; color: #1a1c1e; }

.db-day-btns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.db-day-btns .btn-start {
  border: none; background: var(--ib-blue); color: #fff;
  border-radius: 14px; padding: 14px; font-weight: 800; font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.db-day-btns .btn-end {
  border: 1.5px solid #C62828; background: #fff; color: #C62828;
  border-radius: 14px; padding: 14px; font-weight: 800; font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.db-day-btns button[hidden] { display: none !important; }

/* ——— Bottom nav 5 items ——— */
.bottom-nav {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 0 !important;
  background: #fff !important;
  border-top: 1px solid #e2e8f0 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  height: auto !important;
  min-height: 60px;
}
.bottom-nav .nav-item {
  flex-direction: column !important;
  gap: 2px !important;
  padding: 8px 2px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
}
.bottom-nav .nav-item.active {
  color: var(--ib-blue) !important;
}
.bottom-nav .nav-item.active .nav-icon-wrap {
  color: var(--ib-blue);
}
.bottom-nav .nav-svg { width: 22px; height: 22px; fill: currentColor; }

/* Customers list still works under new chrome */
#screen-customers, #screen-route, #screen-deliver, #screen-orders,
#screen-credit, #screen-customer {
  padding-top: 0;
}
#screen-customers > .filter-row:first-child,
#screen-route > .route-plan-box,
#screen-orders,
#screen-credit,
#screen-deliver,
#screen-customer {
  /* subtle top spacing when global header hidden */
}
.screen-with-ph { /* screens that include page-header */ }

/* ——— SOS EASY mode: huge buttons, almost no reading ——— */
.sos-pad { padding: 12px 12px 24px !important; }
.sos-money {
  display: block; width: 100%; box-sizing: border-box;
  background: #0D47A1; color: #fff; border-radius: 16px;
  padding: 16px; margin-bottom: 14px; text-align: center;
  border: none; font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 12px rgba(13,71,161,.25);
}
.sos-money:active { transform: scale(0.99); opacity: 0.95; }
.sos-flash {
  outline: 3px solid #FB8C00 !important;
  box-shadow: 0 0 0 6px rgba(251,140,0,.35) !important;
  transition: box-shadow .2s ease;
}
.seller-work-row[data-open-id] { cursor: pointer; }
.seller-work-row[data-open-id]:active { opacity: 0.92; }
.sos-money-big {
  font-size: 20px; font-weight: 900; letter-spacing: 0.02em;
  line-height: 1.35;
}
.sos-money-sub {
  font-size: 12px; font-weight: 700; opacity: 0.9; margin-top: 6px;
}
.sos-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 16px;
}
.sos-grid-4 { grid-template-columns: 1fr 1fr; }
.sos-btn {
  border: none; border-radius: 18px;
  min-height: 88px; padding: 16px 8px;
  font-size: 20px; font-weight: 900; font-family: inherit;
  color: #fff; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  letter-spacing: 0.02em;
}
.sos-btn:active { transform: scale(0.98); }
.sos-green { background: #2E7D32; }
.sos-red { background: #C62828; }
.sos-blue { background: #1565C0; }
.sos-orange { background: #EF6C00; }
.sos-purple { background: #6A1B9A; }
.sos-teal { background: #00838F; }
.sos-navy { background: #0c4a6e; }
.sos-btn[hidden] { display: none !important; }
.lang-toggle {
  display: flex; gap: 6px; justify-content: center; margin-top: 8px;
}
.lang-btn {
  border: 2px solid #bae6fd; background: #f0f9ff; color: #0369a1;
  border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 13px;
  cursor: pointer;
}
.lang-btn.active { background: #0c4a6e; border-color: #0c4a6e; color: #fff; }
.sos-next, .sos-call-box {
  background: #fff; border-radius: 16px; padding: 12px;
  margin-bottom: 12px; border: 2px solid #e2e8f0;
}
.sos-next-title {
  font-size: 16px; font-weight: 900; color: #0D47A1;
  margin-bottom: 8px;
}
.sos-call-box .seller-work-row { margin-bottom: 10px; }
.sos-call-box .sw-actions a,
.sos-call-box .sw-actions button {
  min-height: 48px !important; font-size: 16px !important;
  flex: 1; justify-content: center;
}
/* Deliver SOS: bigger steppers */
#screen-deliver .step-btn { min-height: 64px !important; font-size: 32px !important; }
#screen-deliver .step-val { font-size: 40px !important; min-height: 64px; }
#screen-deliver .pay-btn { min-height: 56px !important; font-size: 16px !important; font-weight: 800; }
#del-save { min-height: 56px !important; font-size: 22px !important; font-weight: 900; }

/* Seller tools — money target, work list, memory card, mini chart */
.seller-money-target {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(21,101,192,.06);
}
.seller-money-target .smt-title {
  font-size: 13px; font-weight: 800; color: #0f172a; margin-bottom: 4px;
}
.seller-money-target .smt-line {
  font-size: 13px; font-weight: 600; color: #334155; line-height: 1.4;
}
.smt-hint { font-size: 11px; color: #64748b; font-weight: 600; margin: 0 0 8px; }
.smt-chart { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.smt-bar-wrap {
  display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center;
  font-size: 10px; font-weight: 700; color: #64748b;
}
.smt-bar-wrap > span:last-child { text-align: right; }
.smt-bar {
  height: 10px; border-radius: 999px; min-width: 4px;
  background: #cbd5e1; transition: width .25s ease;
}
.smt-bar.cash { background: #43A047; }
.smt-bar.credit { background: #E53935; }
.smt-bar.coupon { background: #FB8C00; }

.seller-work {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.seller-work-row {
  border: 1px solid #fecaca;
  background: #fff7f7;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}
.seller-work-row.bottles { border-color: #bae6fd; background: #f0f9ff; }
.seller-work-row.revisit { border-color: #fde68a; background: #fffbeb; }
.seller-work-row .sw-name { font-weight: 800; font-size: 14px; color: #0f172a; }
.seller-work-row .sw-why {
  font-size: 12px; font-weight: 600; color: #64748b; margin: 3px 0 8px; line-height: 1.35;
}
.seller-work-row .sw-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.seller-work-row .sw-actions a,
.seller-work-row .sw-actions button {
  font-size: 14px; font-weight: 800; padding: 10px 14px; border-radius: 12px;
  border: none; cursor: pointer; font-family: inherit; text-decoration: none;
  background: #1565C0; color: #fff; min-height: 42px;
  display: inline-flex; align-items: center;
}
.seller-work-row .sw-name { font-size: 16px !important; }
.seller-work-row .sw-why { font-size: 13px !important; }
.home-qa .qa-l { font-size: 11px !important; font-weight: 800; }
.home-start-route, .home-end-btn, .add-form-actions .btn-save, .add-form-actions .btn-cancel {
  font-size: 16px !important; min-height: 52px;
}
#del-use-usual {
  font-size: 16px !important; font-weight: 800 !important; min-height: 48px !important;
  background: #1565C0 !important; color: #fff !important;
}
.seller-work-row .sw-actions .soft {
  background: #e2e8f0; color: #0f172a;
}
.seller-work .empty { font-size: 13px; color: #64748b; font-weight: 600; padding: 8px 0; }

.memory-card {
  margin: 10px 0;
  padding: 12px;
  background: #E3F2FD;
  border: 1px solid #90CAF9;
  border-radius: 12px;
}
.memory-card .mc-title {
  font-size: 12px; font-weight: 800; color: #0D47A1; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .03em;
}
.memory-card .mc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
}
.memory-card .mc-item {
  background: #fff; border-radius: 8px; padding: 8px;
  border: 1px solid #e3f2fd;
}
.memory-card .mc-item .k {
  display: block; font-size: 10px; font-weight: 700; color: #64748b;
}
.memory-card .mc-item .v {
  display: block; font-size: 14px; font-weight: 800; color: #0f172a; margin-top: 2px;
}
.memory-card .mc-item.wide { grid-column: 1 / -1; }
.memory-card .mc-item.alert .v { color: #C62828; }

@media (max-width: 360px) {
  .db-metrics { grid-template-columns: 1fr 1fr; }
  .home-qa .qa-l { font-size: 8px; }
  .db-metric .dm-v { font-size: 12px; }
  .memory-card .mc-grid { grid-template-columns: 1fr; }
}
