:root{
  --bg:#F2F3F7;
  --card:#FFFFFF;
  --text:#111827;
  --muted:#6B7280;
  --line:#E5E7EB;

  --red:#E30613;
  --red2:#C70510;

  --orange:#F59E0B;
  --green:#16A34A;
  --gray:#9CA3AF;

  --r:20px;
  --shadow:0 18px 44px rgba(17,24,39,.10);
  --shadow2:0 8px 18px rgba(17,24,39,.08);

  --tap:rgba(17,24,39,.06);
}

/* ===== Base ===== */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "SF Pro Display",
               "Segoe UI", Roboto, Arial;
  color:var(--text);
  background:var(--bg);
  line-height:1.25;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* FIX: SVG default size (інакше браузер ставить 300x150) */
svg{display:block}


/* ===== Layout ===== */
.container{
  max-width:980px;
  margin:0 auto;
  padding:0px 16px calc(92px + env(safe-area-inset-bottom));
}
.btn-outline {
  display: none !important;
}
.small{font-size:13px;color:var(--muted); display: none;}
.mt8{margin-top:8px}
.mt12{margin-top:12px;}
.mt16{margin-top:16px}
.orders-list .mt12{
  display: none;
}
.card.hero-card {
  margin-top: 7px;
}
/* ===== AppBar (iOS) ===== */
.appbar{
  position:sticky; top:0; z-index:50;
  padding-top: env(safe-area-inset-top);
  background:rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom:1px solid rgba(229,231,235,.75);
}

.appbar__inner{
  max-width:980px;
  margin:0 auto;
  height:56px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.title{
  font-weight:950;
  font-size:17px;
  letter-spacing:.2px;
  text-align:center;
  flex:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* ===== Icon buttons ===== */
.iconbtn{
  width:44px; height:44px;
  border:0;
  background:transparent;
  border-radius:14px;
  display:grid; place-items:center;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:active{ background:var(--tap); }

.icon{ width:22px; height:22px; display:block; }
.icon.red{ color: var(--red); }

/* ===== Cards ===== */
.card{
  background:var(--card);
  border-radius:var(--r);
  border:1px solid rgba(229,231,235,.75);
  box-shadow: var(--shadow2);
  overflow:hidden;
}

.card + .card{ margin-top:12px; }

.pad{ padding:16px; }

.card--done{
  opacity:.72;
  filter: grayscale(.10);
}

/* section title like modern apps */
.section-title{
  margin:14px 6px 10px;
  font-size:13px;
  font-weight:900;
  letter-spacing:.3px;
  color:#6B7280;
  text-transform:uppercase;
}

/* ===== Segmented ===== */
.segmented{
  display:flex;
  gap:8px;
  margin:6px 0 12px;
}

.seg{
  flex:1;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(229,231,235,.9);
  background:rgba(255,255,255,.85);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  font-size:13px;
  color:#374151;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: transform .12s ease, box-shadow .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.seg:active{ transform: scale(.99); }
.seg.active{
  color:var(--red);
  border-color: rgba(227,6,19,.25);
  background:#fff;
  box-shadow: var(--shadow2);
}

/* ===== Search ===== */
.search{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(229,231,235,.9);
  background:#fff;
  box-shadow: var(--shadow2);
}
.search input{
  width:100%;
  border:0;
  outline:0;
  font-size:15px;
}
.search .x{
  width:36px; height:36px;
  border:0; background:transparent;
  border-radius:12px;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}
.search .x:active{ background:var(--tap); }

/* ===== Order card text ===== */
.order-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.order-id{
  font-size:22px;
  font-weight:950;
  letter-spacing:.3px;
  display:flex;
  gap:8px;
  align-items:baseline;
  line-height:1.05;
}
.order-id .light{
  font-weight:800;
  color:#374151;
  font-size:12px;
}

.order-title{
  margin-top:6px;
  font-weight:950;
  font-size:15px;
  line-height:1.25;
}

.meta-row{
  margin-top:8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
  color:var(--muted);
}

.route-row{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight:900;
}
.route-row .mid{ opacity:.55; }

/* ===== Pills ===== */
.pills{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  border-radius:999px;
  font-size:13px;
  font-weight:950;
  border:1px solid rgba(229,231,235,.9);
  background:#F9FAFB;
  white-space:nowrap;
}

.pill.red{
  background: rgba(227,6,19,.10);
  border-color: rgba(227,6,19,.22);
  color: var(--red);
}
.pill.gray{ background:#F3F4F6; color:#374151; }
.pill.green{
  background: rgba(22,163,74,.10);
  border-color: rgba(22,163,74,.22);
  color: var(--green);
}
.pill.orange{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.25);
  color:#B45309;
}

/* ===== Chevron ===== */
.chev{
  width:22px;
  height:22px;
  opacity:.35;
}

/* ===== Progress (NP-like) ===== */
.progress{
  position:relative;
  height:28px;
  margin:12px 16px 6px;
}

.progress__track{
  position:absolute;
  left:0; right:0;
  top:13px;
  height:4px;
  border-radius:999px;
  background:#E5E7EB;
}

.progress__fill{
  position:absolute;
  left:0;
  top:13px;
  height:4px;
  border-radius:999px;
  width: var(--p, 40%);
  background: var(--orange);
}

.dot{
  position:absolute;
  top:8px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#D1D5DB;
  border:2px solid #fff;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.dot.on{ background: var(--orange); }
.dot.a{ left:0; transform:translateX(-2px); }
.dot.b{ left:33%; transform:translateX(-7px); }
.dot.c{ left:66%; transform:translateX(-7px); }
.dot.d{ right:0; transform:translateX(2px); }

.truck{
  position:absolute;
  top:-2px;
  left: var(--p, 40%);
  transform: translateX(-50%);
  width:30px;
  height:30px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(229,231,235,.9);
  box-shadow:0 12px 30px rgba(17,24,39,.14);
  display:grid;
  place-items:center;
}
.truck svg{ width:18px; height:18px; opacity:.85; }

/* ===== Status title ===== */
.status-title{
  text-align:center;
  font-weight:950;
  font-size:16px;
  padding:10px 14px 12px;
}

.status-title .st-ico{
  display:inline-grid;
  place-items:center;
  width:18px;
  height:18px;
  margin-right:8px;
  vertical-align:-3px;
  opacity:.9;
}
.status-title .st-ico svg{ width:18px; height:18px; }

/* ===== Buttons ===== */
button, .btn-primary, .btn-outline, .seg{
  -webkit-appearance:none;
  appearance:none;
  font-family: inherit;
}

.btn-outline{
  width:100%;
  height:48px;
  border-radius:16px;
  border:2px solid rgba(227,6,19,.35);
  background:#fff;
  color:var(--red);
  font-weight:950;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}
.btn-outline:active{ background: rgba(227,6,19,.06); transform: scale(.995); }

.btn-primary{
  width:100%;
  height:52px;
  border-radius:16px;
  border:0;
  background: var(--red);
  color:#fff;
  font-weight:950;
  font-size:15px;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 16px 34px rgba(227,6,19,.22);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:active{
  background: var(--red2);
  transform: scale(.995);
  box-shadow: 0 12px 26px rgba(227,6,19,.18);
}

/* ===== Inputs ===== */
.input{
  width:100%;
  height:48px;
  border-radius:16px;
  border:1px solid rgba(229,231,235,.9);
  background:#fff;
  padding:0 14px;
  font-size:15px;
  outline:none;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow .12s ease, border-color .12s ease;
}
.input:focus{
  border-color: rgba(227,6,19,.35);
  box-shadow: 0 0 0 4px rgba(227,6,19,.10);
}

/* ===== Row items (detail sections) ===== */
.rowitem{
  padding:14px 16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.rowitem + .rowitem{ border-top:1px solid rgba(229,231,235,.85); }

.rowitem .left{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.ico{
  width:28px;
  height:28px;
  border-radius:12px;
  background:#F3F4F6;
  display:grid;
  place-items:center;
  flex:0 0 28px;
}
.ico.red{ background: rgba(227,6,19,.10); color: var(--red); }
.ico.green{ background: rgba(22,163,74,.10); color: var(--green); }
.ico svg{ width:18px; height:18px; }

.rowitem .left > div:last-child{
  padding-top:1px;
}

/* ===== Chips ===== */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.chip{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(229,231,235,.9);
  background:#fff;
  color: #333;
  font-weight:950;
  font-size:13px;
  line-height:1;
  min-height:40px;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .12s ease;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.chip:active{ background:var(--tap); transform: scale(.995); }
.chip-ico{ width:16px; height:16px; display:inline-grid; place-items:center; opacity:.9; }
.chip-ico svg{ width:16px; height:16px; }
.chip-check{ width:16px; height:16px; display:inline-grid; place-items:center; margin-left:2px; opacity:.85; }
.chip-check svg{ width:16px; height:16px; }
.chip-txt{ white-space:nowrap; color: #333;}

.chip.active{
  border-color: rgba(227,6,19,.30);
  color: var(--red);
  background: rgba(227,6,19,.06);
}
.chip:disabled{
  opacity:.45;
  cursor:not-allowed;
}

/* ===== Floating Action Button ===== */
.fab{
  position:fixed;
  right:16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width:56px;
  height:56px;
  border-radius:18px;
  background: var(--red);
  box-shadow: 0 18px 44px rgba(227,6,19,.28);
  display:grid;
  place-items:center;
  border:0;
  z-index:60;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease;
}
.fab:active{ background: var(--red2); transform: scale(.99); }
.fab svg{ width:24px; height:24px; color:#fff; }

/* ===== Toast ===== */
.toast{
  position:fixed;
  left:50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(17,24,39,.92);
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  font-weight:950;
  font-size:13px;
  display:none;
  z-index:80;
}
.toast.show{ display:block; }

/* ===== Tap highlight off ===== */
a, button { -webkit-tap-highlight-color: transparent; }

/* ===== Optional: smooth card hover (desktop) ===== */
@media (hover:hover){
  a:hover .card{ box-shadow: var(--shadow); transform: translateY(-1px); transition: .15s ease; }
}

/* =========================================================
   Dense list: максимально компактні картки замовлень (index.php)
   ========================================================= */
.orders-dense{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.order-link{ display:block; }

.card.order-item{ box-shadow: var(--shadow2); }

.order-item__wrap{ padding:10px 12px; }

.order-item__top{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:start;
}

.order-item__id{
  font-weight:950;
  font-size:15px;
  line-height:1;
  letter-spacing:.2px;
  min-width:46px;
  color:#111827;
}
.order-item__id span{
  color:#6B7280;
  font-weight:900;
  font-size:12px;
  margin-right:2px;
}

.order-item__title{
  font-weight:950;
  font-size:13px;
  line-height:1.25;
  max-height:2.5em;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}

.order-item__meta{
  margin-top:6px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  color:var(--muted);
}
.order-item__meta b{ color:#374151; }

.order-item__badges{
  display:flex;
  flex-direction:column;
  gap:6px;
  align-items:flex-end;
}

.pill.mini{
  padding:6px 10px;
  font-size:12px;
}

.order-item__bar{
  margin-top:8px;
  height:3px;
  border-radius:999px;
  background:rgba(229,231,235,.95);
  overflow:hidden;
}
.order-item__bar > i{
  display:block;
  height:100%;
  width: var(--p, 40%);
  background: var(--c, var(--orange));
  border-radius:999px;
}

.order-link:active .card{ transform: scale(.997); }

/* =========================================================
   Order details (order.php) – більш "app-like" та зручніше
   ========================================================= */
.hero-card{
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,.86) 100%);
}

.hero-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.hero-title{
  font-weight:950;
  font-size:18px;
  line-height:1.15;
}

.hero-sub{
  margin-top:6px;
  font-size:10px;
  color:var(--muted);
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.kv {
    display: inline-flex;
    gap: 3px;
    align-items: center;
    padding: 3px 5px;
    border-radius: 999px;
    border: 1px solid rgba(229,231,235,.9);
    background: #fff;
    font-weight: 900;
}

.kv-ico{
  display:inline-grid;
  place-items:center;
  width:16px;
  height:16px;
  margin-right:6px;
  opacity:.9;
}
.kv-ico svg{ width:16px; height:16px; }

.card-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:950;
}
.card-ico{
  width:18px;
  height:18px;
  display:inline-grid;
  place-items:center;
  opacity:.9;
}
.card-ico svg{ width:18px; height:18px; }
.kv b{ color:#374151; }

.kv .dotmini{
  width:7px;height:7px;border-radius:999px;background:var(--gray);
  opacity:.9;
}

.kv.green .dotmini{ background: var(--green); }
.kv.orange .dotmini{ background: var(--orange); }
.kv.gray .dotmini{ background: var(--gray); }

.textarea{
  width:100%;
  border-radius:16px;
  border:1px solid rgba(229,231,235,.9);
  background:#fff;
  padding:12px 14px;
  font-size:15px;
  outline:none;
  resize: vertical;
  min-height:120px;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.textarea:focus{
  border-color: rgba(227,6,19,.35);
  box-shadow: 0 0 0 4px rgba(227,6,19,.10);
}

.order-photo-wrap{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:12px;
  padding:10px;
  border:1px solid rgba(229,231,235,.9);
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,1), rgba(249,250,251,1));
}

.order-photo-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr)); /* 25% */
  gap:8px;
  width:100%;
}

.order-photo-btn{
  display:block;
  width:100%;
  padding:0;
  border:0;
  border-radius:14px;
  background:transparent;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}

.order-photo{
  display:block;
  width:100%;
  aspect-ratio:1 / 1;
  object-fit:cover;
  border-radius:14px;
  border:1px solid rgba(229,231,235,.9);
  background:#fff;
  box-shadow:0 10px 24px rgba(17,24,39,.08);
}

.order-photo-btn:active .order-photo{
  transform:scale(.98);
  transition:transform .1s ease;
}

.file-input{
  height:auto;
  min-height:54px;
  padding:8px 10px;
  display:block;
  background:linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
  border:1px solid rgba(229,231,235,.95);
  box-shadow:0 10px 20px rgba(17,24,39,.04);
}

.file-input::file-selector-button{
  border:0;
  margin-right:12px;
  padding:10px 14px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(227,6,19,.95), rgba(199,10,21,.95));
  color:#fff;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(227,6,19,.20);
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.file-input::file-selector-button:hover{
  filter:brightness(1.02);
}

.file-input::file-selector-button:active{
  transform:translateY(1px);
  box-shadow:0 6px 14px rgba(227,6,19,.18);
}

.file-input::-webkit-file-upload-button{
  border:0;
  margin-right:12px;
  padding:10px 14px;
  border-radius:12px;
  background:linear-gradient(180deg, rgba(227,6,19,.95), rgba(199,10,21,.95));
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.photo-modal{
  position:fixed;
  inset:0;
  z-index:120;
}

.photo-modal[hidden]{
  display:none !important;
}

.photo-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(17,24,39,.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.photo-modal__dialog{
  position:absolute;
  inset:16px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.photo-modal__img{
  max-width:100%;
  max-height:100%;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.22);
  background:#0b1220;
  box-shadow:0 28px 70px rgba(0,0,0,.45);
  object-fit:contain;
}

.photo-modal__close{
  position:absolute;
  top:max(8px, env(safe-area-inset-top));
  right:0;
  width:42px;
  height:42px;
  border:0;
  border-radius:14px;
  background:rgba(255,255,255,.16);
  color:#fff;
  font-size:28px;
  line-height:1;
  display:grid;
  place-items:center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.photo-modal-open{
  overflow:hidden;
}

.status-sheet-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.35);
  z-index: 105;
}

/* компактніший прогрес на order.php */
.progress.compact{
  height:22px;
  margin:10px 16px 6px;
}
.progress.compact .truck{ display:none; }
.progress.compact .dot{ top:5px; width:12px;height:12px; }
.progress.compact .progress__track,
.progress.compact .progress__fill{ top:10px; }

/* статуси – 2 колонки як у мобільних меню */
.status-chips{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:8px;
}

/* sticky bottom area for primary actions (mobile feel) */
.bottom-actions{
  position:sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index:20;
  padding:10px;
  margin-top:12px;
  background: rgba(242,243,247,.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border:1px solid rgba(229,231,235,.7);
  border-radius:18px;
}

.bottom-actions .row{
  display:flex;
  gap:10px;
}
.bottom-actions .row > *{ flex:1; }


/* =========================================================
   Dense Orders List (мобільний "app" вигляд для головного списку)
   ========================================================= */

.orders-dense{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding-bottom:90px; /* щоб FAB не перекривав останні елементи */
}

.list-item{
  display:block;
  text-decoration:none;
  color:inherit;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(17,24,39,.06);
  overflow:hidden;
  -webkit-tap-highlight-color: transparent;
}

.list-item:active{ transform: scale(.995); }

.list-item.is-done{
  opacity:.62;
  background: rgba(249,250,251,.92);
}

.list-item__row{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px 12px 8px;
}

.list-item__badge{
  width:42px;
  height:42px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(245,158,11,.12);
  color: var(--orange);
  flex:0 0 auto;
  position:relative;
}

.list-item__badge{ background: rgba(17,24,39,.05); border:1px solid rgba(229,231,235,.9); color: var(--c); }

.list-item__badge svg{ width:20px; height:20px; }

.list-item__main{ flex:1; min-width:0; }

.list-item__title{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.list-item__title .t{
  font-size:12px;
  font-weight:950;
  letter-spacing:.2px;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.list-item__meta{
  margin-top:4px;
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  font-size:12px;
  color: var(--muted);
}

.list-item__meta .m{
  display:inline-flex;
  gap:6px;
  align-items:center;
  white-space:nowrap;
}

.list-item__meta .mi{
  width:14px;
  height:14px;
  display:inline-flex;
  color: var(--muted);
  opacity:.9;
}

.list-item__meta .mi svg{ width:14px; height:14px; }

.list-item__chev{
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted);
  opacity:.85;
  flex:0 0 auto;
}

.list-item__chev svg{ width:18px; height:18px; }

.list-item__bottom{
  padding:0 12px 12px;
}

.list-item__statusline{
  display: none !important;
  margin-top:6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.list-item__statusline .s{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12.5px;
  font-weight:900;
  color: var(--text);
}

.list-item__statusline .si{
  width:16px;
  height:16px;
  display:inline-flex;
  color: var(--red);
}

.list-item__statusline .si svg{ width:16px; height:16px; }

.mini-tag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11.5px;
  font-weight:900;
  border:1px solid rgba(229,231,235,.9);
  background:#F9FAFB;
  color: var(--muted);
  white-space:nowrap;
}

.mini-tag svg{ width:14px; height:14px; }

.mini-tag--urgent{
  background: rgba(227,6,19,.10);
  border-color: rgba(227,6,19,.22);
  color: var(--red);
}

/* прогрес як в order.php, але компактніше для списку */
.progress--mini{
  height:22px;
  margin:6px 0 0;
}

.progress--mini .progress__track,
.progress--mini .progress__fill{
  top:10px;
  height:3px;
}

.progress--mini .dot{
  width:6px;
  height:6px;
  top:9px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.95);
}

.progress--mini .truck{
  width:22px;
  height:22px;
  top:-1px;
  border-radius:999px;
}

.progress--mini .truck svg{ width:14px; height:14px; }

.chip--urgent{
  min-height: auto !important;
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding: 4px 8px ;
  border-radius:999px;
  font-size:11.5px;
  font-weight:950;
  background: rgba(227,6,19,.10);
  border:1px solid rgba(227,6,19,.22);
  color: var(--red);
  white-space:nowrap;
}

.chip--urgent .chip__ico{ width:14px; height:14px; display:inline-flex; }
.chip--urgent svg{ width:14px; height:14px; }


/* =========================
   v4: denser orders list (no badge) + highlighted dates + progress like order.php
   ========================= */

.list-item{
  border-radius: 16px;
}

.list-item__row{
  padding: 8px 10px 0;
  gap: 10px;
  align-items: flex-start;
}

.list-item__main{ min-width: 0; }

.list-item__title{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap: wrap;
}

.list-item__title .t{
  font-size: 14px;
  line-height: 1.2;
  font-weight: 950;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 950;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(229,231,235,.9);
  box-shadow: 0 10px 22px rgba(17,24,39,.06);
  white-space: nowrap;
}

.status-pill .spi{
  width:14px;
  height:14px;
  display:inline-grid;
  place-items:center;
  color: var(--orange);
}
.status-pill .spi svg{ width:14px; height:14px; }

/* allow per-status accent color via --c */
.status-pill{
  border-color: color-mix(in srgb, var(--c) 22%, rgba(229,231,235,.9));
}
.status-pill .spi{ color: var(--c); }

.list-item__meta{
  margin-top: 4px;
  gap: 6px 10px;
  font-size: 11.5px;
}

.list-item__meta .m{
  padding: 2px 6px;
  border-radius: 10px;
}

.list-item__meta .m--created{
  background: rgba(17,24,39,.04);
  border: 1px solid rgba(17,24,39,.06);
}

.list-item__meta .m--updated{
  background: linear-gradient(180deg, rgba(59,130,246,.14), rgba(59,130,246,.08));
  border: 1px solid rgba(59,130,246,.22);
  color: color-mix(in srgb, var(--primary) 75%, #0f172a);
  font-weight: 950;
}

.list-item__chev{
  width: 26px;
  height: 26px;
  border-radius: 10px;
}
.list-item__chev svg{ width:16px; height:16px; }

.list-item__bottom{
  padding: 0 10px 10px;
}

/* Progress like order.php, but tiny for list */
.progress--tiny{
  height: 20px;
  margin: 6px 0 0;
}
.progress--tiny .progress__track,
.progress--tiny .progress__fill{
  top: 9px;
  height: 3px;
}
.progress--tiny .dot{
  width: 6px;
  height: 6px;
  top: 8px;
}
.progress--tiny .truck{
  width: 22px;
  height: 22px;
  top: -1px;
  box-shadow: 0 10px 22px rgba(17,24,39,.10);
}
.progress--tiny .truck svg{ width: 13px; height: 13px; }

/* FIX: show icon marker on compact progress too (order.php) */
.progress.compact .truck{ display: grid; }

/* Make kv chips feel more "app-like" inside padded cards */
.pad .kv{
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(249,250,251,1));
  box-shadow: 0 10px 22px rgba(17,24,39,.06);
  border-color: rgba(229,231,235,.85);
}

/* More readable, color-coded kv pills (mobile-app vibe) */
.pad .kv.kv--created{
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.20);
}
.pad .kv.kv--user{
  background: rgba(20,184,166,.08);
  border-color: rgba(20,184,166,.20);
}
.pad .kv.kv--updated{
  background: linear-gradient(180deg, rgba(99,102,241,.11), rgba(255,255,255,.95));
  border-color: rgba(99,102,241,.22);
  box-shadow: 0 12px 26px rgba(99,102,241,.10);
}
.pad .kv.kv--updated b{
  padding:2px 8px;
  border-radius:10px;
  background: rgba(99,102,241,.12);
  border:1px solid rgba(99,102,241,.18);
}

/* Status kv uses the order status color (like the status pill on list) */
.pad .kv.kv--status{
  background: color-mix(in srgb, var(--c) 12%, white);
  border-color: color-mix(in srgb, var(--c) 28%, rgba(229,231,235,.9));
  color: color-mix(in srgb, var(--c) 78%, #111827);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c) 18%, transparent);
}
.pad .kv.kv--status .kv-ico{
  border-radius:10px;
  background: color-mix(in srgb, var(--c) 16%, white);
  border:1px solid color-mix(in srgb, var(--c) 26%, rgba(229,231,235,.9));
  width:18px;
  height:18px;
  margin-right:6px;
}

/* Keep old simple color helpers (used elsewhere) */
.pad .kv.orange{
  background: rgba(255,127,0,.08);
  border-color: rgba(255,127,0,.20);
}
.pad .kv.green{
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.18);
}
.pad .kv.gray{
  background: rgba(148,163,184,.10);
  border-color: rgba(148,163,184,.22);
}


/* ===== Forms (app-like) ===== */
.form{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.field{ display:flex; flex-direction:column; gap:8px; }
.field__label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  font-size:12px;
  color: var(--muted);
  letter-spacing:.2px;
}
.field__label .icon{
  width:16px;
  height:16px;
  color: var(--muted);
}

/* nicer select arrow */
select.input{
  -webkit-appearance:none;
  appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(17,24,39,.65) 50%),
    linear-gradient(135deg, rgba(17,24,39,.65) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
  padding-right:40px;
}


/* Заборонити скрол на сторінці деталей замовлення */
body.page-order-details {
  height: 100vh;
 
}

/* Автопідказки для поля "Автомобіль" */
.car-field {
  position: relative;
}

/* Контейнер підказок */
.car-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 260px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
}

/* Показаний стан */
.car-suggestions.is-visible {
  display: block;
}

/* Окремий елемент підказки */
.car-suggestions .suggestion-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 16px;
  line-height: 1.3;
  cursor: pointer;
}

/* Лінія між елементами */
.car-suggestions .suggestion-item + .suggestion-item {
  border-top: 1px solid #f1f1f1;
}

/* Тап по підказці на мобільному */
.car-suggestions .suggestion-item:active {
  background: #f5f5f5;
}

/* Коли нічого не знайдено */
.car-suggestions .suggestion-empty {
  color: #999;
  font-style: italic;
}

input,
textarea,
select {
  font-size: 16px !important;
}

/* =========================================================
   Compact app mode for order details (phone height fit)
   ========================================================= */
@media (max-width: 430px) {
  body.page-order-details .appbar__inner{
    height: 50px;
    padding: 6px 8px;
  }

  body.page-order-details .iconbtn{
    width:38px;
    height:38px;
    border-radius:12px;
  }

  body.page-order-details .title{
    font-size:15px;
  }

  body.page-order-details .container{
    padding: 0 8px calc(8px + env(safe-area-inset-bottom));
  }

  body.page-order-details .card{
    border-radius: 14px;
  }

  body.page-order-details .card + .card{
    margin-top: 8px;
  }

  body.page-order-details .pad{
    padding: 10px;
  }

  body.page-order-details .hero-row{
    gap: 8px;
  }

  body.page-order-details .hero-title{
    font-size: 15px;
    line-height: 1.15;
  }

  body.page-order-details .hero-sub{
    margin-top: 4px;
    gap: 6px;
  }

  body.page-order-details .kv{
    padding: 4px 7px;
    gap: 4px;
    font-size: 11px;
    border-radius: 999px;
  }

  body.page-order-details .kv-ico{
    width: 13px;
    height: 13px;
    margin-right: 2px;
  }

  body.page-order-details .kv-ico svg{
    width: 13px;
    height: 13px;
  }

  body.page-order-details .order-id{
    font-size: 16px !important;
  }

  body.page-order-details .order-id .light{
    font-size: 10px;
  }

  body.page-order-details .progress.compact{
    height: 16px;
    margin: 6px 10px 2px;
  }

  body.page-order-details .progress.compact .dot{
    width: 9px;
    height: 9px;
    top: 4px;
  }

  body.page-order-details .progress.compact .progress__track,
  body.page-order-details .progress.compact .progress__fill{
    top: 7px;
    height: 3px;
  }

  body.page-order-details .status-title{
    font-size: 13px;
    padding: 6px 10px 8px;
  }

  body.page-order-details .status-title .st-ico{
    width: 14px;
    height: 14px;
    margin-right: 4px;
  }

  body.page-order-details .status-title .st-ico svg{
    width: 14px;
    height: 14px;
  }

  body.page-order-details .card-title{
    gap: 8px;
    font-size: 14px;
  }

  body.page-order-details .card-ico,
  body.page-order-details .card-ico svg{
    width: 15px;
    height: 15px;
  }

  body.page-order-details .order-photo-wrap{
    margin-bottom: 8px;
    padding: 8px;
    gap: 8px;
    border-radius: 12px;
  }

  /* 25% width thumbnails in one row, horizontally scrollable to save height */
  body.page-order-details .order-photo-grid{
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.page-order-details .order-photo-grid::-webkit-scrollbar{
    display:none;
  }

  body.page-order-details .order-photo-btn{
    flex: 0 0 25% !important;
    width: 25% !important;
    border-radius: 10px;
  }

  body.page-order-details .order-photo{
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(17,24,39,.08);
  }

  body.page-order-details .textarea{
    min-height: 64px;
    max-height: 88px;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 13px !important;
  }

  body.page-order-details .field{
    gap: 6px;
  }

  body.page-order-details .field__label{
    font-size: 11px;
  }

  body.page-order-details .field__label .icon{
    width: 14px;
    height: 14px;
  }

  body.page-order-details .file-input{
    min-height: 42px;
    padding: 6px 8px;
    border-radius: 12px;
    font-size: 12px !important;
  }

  body.page-order-details .file-input::file-selector-button,
  body.page-order-details .file-input::-webkit-file-upload-button{
    padding: 8px 10px;
    border-radius: 10px;
    margin-right: 8px;
    font-size: 12px;
  }

  body.page-order-details .bottom-actions{
    position: static;
    padding: 6px;
    margin-top: 8px;
    border-radius: 12px;
  }

  body.page-order-details .bottom-actions .row{
    gap: 6px;
  }

  body.page-order-details .btn-primary,
  body.page-order-details .btn-outline{
    height: 38px;
    min-height: 38px;
    border-radius: 12px;
    font-size: 13px;
  }

  body.page-order-details .status-chips{
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  body.page-order-details .chip{
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 12px;
    gap: 8px;
  }

  body.page-order-details .chip-ico,
  body.page-order-details .chip-ico svg,
  body.page-order-details .chip-check,
  body.page-order-details .chip-check svg{
    width: 16px;
    height: 16px;
  }

  body.page-order-details .chip-txt{
    font-size: 13px;
    line-height: 1.05;
  }

  /* Status as bottom-sheet on phones: doesn't consume page height */
  body.page-order-details #status{
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    margin-top: 0 !important;
    z-index: 110;
    max-height: min(52vh, 420px);
    overflow: auto;
    box-shadow: 0 22px 50px rgba(17,24,39,.20);
    transform: translateY(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
    transition: transform .18s ease, opacity .18s ease;
  }

  body.page-order-details.status-sheet-open #status{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.page-order-details #status .pad{
    padding: 10px;
  }
}

@media (max-width: 430px) and (max-height: 760px) {
  body.page-order-details .hero-title{
    font-size: 14px;
  }

  body.page-order-details .status-chips{
    grid-template-columns: repeat(4, 1fr);
  }

  body.page-order-details .chip-ico,
  body.page-order-details .chip-check{
    display:inline-grid;
  }
}

/* iPhone auto-zoom fix on focus: keep form controls >=16px */
@media (max-width: 820px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }

  .input,
  .textarea,
  .search input,
  .file-input {
    font-size: 16px !important;
  }

  .file-input::file-selector-button,
  .file-input::-webkit-file-upload-button {
    font-size: 14px !important;
  }
}
