/* ============================================================================
   JAI AMBE PHARMA — v5.1   "Mint Slate" theme
   Vanilla CSS. Mobile-first. No frameworks.
   ============================================================================ */

:root{
  /* "Corporate Navy + Slate" — primary kept under the --teal/--mint var names
     so the whole sheet recolours from here without renaming every rule. */
  --teal:#1E3A8A; --teal-d:#172E6E; --mint:#DBEAFE; --mint-2:#EFF6FF;
  --amber:#2563EB; --green:#25D366; --rose:#E11D48; --violet:#7C3AED; --blue:#2563EB;
  --bg:#F8FAFC; --card:#FFFFFF; --ink:#0F172A; --muted:#64748B; --border:#E2E8F0;
  --shadow:0 1px 3px rgba(15,23,42,.08),0 1px 2px rgba(15,23,42,.04);
  --shadow-lg:0 10px 30px rgba(15,23,42,.12);
  --r:14px; --r-sm:10px;
  --top-h:108px;   /* frozen top nav height (brand row removed) */
  --bot-h:64px;    /* bottom nav height */
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ margin:0; padding:0; height:100%; }
body{
  background:var(--bg); color:var(--ink);
  font-family:'Inter',system-ui,sans-serif; font-size:15px; line-height:1.4;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.brand,.section-title{ font-family:'Outfit','Inter',sans-serif; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }
.material-symbols-rounded{ font-variation-settings:'wght' 500,'opsz' 24; vertical-align:middle; }

/* ---------- login / identify / status / install gates ---------------------- */
#loginGate, .gate-overlay {
  position:fixed; inset:0; z-index:400; display:none;
  background:linear-gradient(160deg,var(--teal) 0%,var(--teal-d) 100%);
  padding:20px 14px calc(24px + env(safe-area-inset-bottom));
  overflow-y:auto; align-items:flex-start; justify-content:center;
}
.gate-overlay { z-index: 450; align-items:center; }
#loginGate.on, .gate-overlay.on { display:flex; }
.login-card, .status-card {
  width:100%; max-width:440px; margin:auto; background:var(--card); border-radius:20px;
  padding:22px 18px; box-shadow:var(--shadow-lg); text-align:center;
}
.status-card { max-width:380px; padding:26px 22px; }
.status-card h2 { font-size:22px; font-weight:800; margin:14px 0 6px; color:var(--teal); }
.status-card p { font-size:13.5px; color:var(--muted); margin:8px 0 14px; line-height:1.5; }
.status-details {
  background:var(--bg); border:1.5px solid var(--border); border-radius:12px;
  padding:12px 14px; margin:16px 0; text-align:left; font-size:13px;
}
.status-details div { margin-bottom: 6px; }
.status-details div:last-child { margin-bottom: 0; }
.status-details b { color:var(--ink); }
.status-card button, .status-card a.btn-support {
  display: block; width:100%; margin-top:10px; padding:12px; border:none; border-radius:12px;
  font-size:15px; font-weight:800; cursor:pointer; text-decoration:none; text-align:center;
}
.status-card button.btn-primary { background:var(--teal); color:#fff; }
.status-card button.btn-primary:active { transform:scale(.99); }
.status-card button.btn-secondary, .status-card a.btn-support {
  background:var(--bg); color:var(--teal); border:1.5px solid var(--border);
}
.status-card button.btn-secondary:active, .status-card a.btn-support:active { transform:scale(.99); }
.install-steps {
  text-align: left; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin: 16px 0; font-size: 13.5px;
}
.install-steps div { margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.install-steps div:last-child { margin-bottom: 0; }
.login-logo img{ width:52px; height:52px; border-radius:14px; object-fit:cover; }
.login-card h1{ font-size:20px; font-weight:800; margin:10px 0 2px; color:var(--teal); letter-spacing:.3px; }
.login-sub{ font-size:11px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; color:var(--muted); margin:0; }
.login-hint{ font-size:12.5px; color:var(--muted); margin:10px 0 14px; }
.login-card label{ display:block; text-align:left; font-size:11.5px; font-weight:700; color:var(--ink); margin:10px 2px 4px; }
.login-card label span{ color:var(--rose); }
.login-card input, .login-card select{
  width:100%; padding:10px 12px; border:1.5px solid var(--border); border-radius:11px;
  background:var(--bg); font-size:14.5px; color:var(--ink);
}
.login-card input:focus, .login-card select:focus{ outline:none; border-color:var(--teal); background:var(--card); }
.login-card input::-webkit-outer-spin-button,
.login-card input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.login-grid-3 { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; }
.login-grid-2 { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
@media (max-width: 380px) {
  .login-grid-2 { grid-template-columns: 1fr; gap: 0; }
}
.login-office-head { display:flex; align-items:center; justify-content:space-between; margin:12px 2px 5px; }
.add-office-btn {
  border:1.5px solid var(--teal); background:var(--mint-2); color:var(--teal);
  font-size:11.5px; font-weight:800; padding:4px 10px; border-radius:999px; cursor:pointer;
}
.add-office-btn:active { transform:scale(.97); }
.login-office-list { display:flex; flex-direction:column; gap:6px; }
.office-num-row { display:flex; gap:6px; align-items:center; }
.office-num-del {
  width:38px; height:38px; flex-shrink:0; border:1.5px solid #FCA5A5; background:#FEF2F2;
  color:var(--rose); border-radius:10px; font-weight:800; font-size:14px; display:flex;
  align-items:center; justify-content:center;
}
#loginBtn{
  width:100%; margin-top:16px; padding:13px; border:none; border-radius:12px;
  background:var(--teal); color:#fff; font-size:16px; font-weight:800;
}
#loginBtn:active{ transform:scale(.99); }
.login-foot{ font-size:11px; color:var(--muted); margin:12px 0 0; }

/* ---------- layout shell --------------------------------------------------- */
#app{ display:flex; flex-direction:column; height:100%; position:fixed; inset:0; }
.app-body{
  flex:1; overflow-y:auto; overflow-x:hidden;
  -webkit-overflow-scrolling:touch; overscroll-behavior-y:contain;
  will-change:transform;
  padding:calc(var(--top-h) + 8px) 10px calc(var(--bot-h) + 14px);
}
.tab-pane{ display:none; }
.tab-pane.on{ display:block; animation:fade .2s ease; }
@keyframes fade{ from{opacity:0; transform:translateY(4px);} to{opacity:1;transform:none;} }

/* ---------- frozen top nav ------------------------------------------------- */
.topnav{
  position:fixed; top:0; left:0; right:0; z-index:50;
  background:var(--card); box-shadow:var(--shadow);
  border-bottom:1px solid var(--border);
  padding-top:env(safe-area-inset-top);
}
.top-row{ display:flex; align-items:center; gap:10px; padding:10px 14px 6px; }
.brand{
  font-size:18px; font-weight:700; letter-spacing:.3px; color:var(--teal);
  display:flex; align-items:center; gap:8px; flex:1; line-height:1.05;
}
.brand small{ display:block; font-size:9.5px; font-weight:600; color:var(--muted);
  letter-spacing:1.2px; text-transform:uppercase; font-family:'Inter'; }
.bell{
  position:relative; width:40px; height:40px; border-radius:50%;
  border:1px solid var(--border); background:var(--card); color:var(--ink);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.bell .dot{ position:absolute; top:7px; right:8px; width:9px; height:9px;
  background:var(--rose); border-radius:50%; border:2px solid var(--card); display:none; }
.bell.has-unread .dot{ display:block; }

/* search + controls row */
.search-row{ display:flex; gap:7px; padding:10px 12px 8px; align-items:center; }
.bell{ width:42px; height:42px; border-radius:var(--r-sm); }
.search-box{ position:relative; flex:1; }
.search-box .material-symbols-rounded{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  color:var(--muted); font-size:20px; }
.search-box input{
  width:100%; padding:10px 38px 10px 38px; border-radius:var(--r-sm);
  border:1.5px solid var(--border); background:var(--bg); font-size:16px; color:var(--ink);
}
.search-box input:focus{ outline:none; border-color:var(--teal); background:var(--card); }
#micBtn.listening {
  color: #fff !important;
  background: var(--rose) !important;
  border-color: var(--rose) !important;
  animation: pulseMic 1.2s infinite alternate;
}
@keyframes pulseMic {
  from { opacity: 0.7; }
  to { opacity: 1; transform: scale(1.05); }
}
.ctrl-btn{
  width:42px; height:42px; flex-shrink:0; border-radius:var(--r-sm);
  border:1.5px solid var(--border); background:var(--card); color:var(--ink);
  display:flex; align-items:center; justify-content:center;
}
.ctrl-btn.active{ background:var(--teal); color:#fff; border-color:var(--teal); }
.col-select{
  height:36px; border-radius:8px; border:1.5px solid var(--border);
  background:var(--bg); color:var(--ink); font-size:13px; font-weight:700;
  padding:0 8px; flex-shrink:0; margin-left:auto;
}
.top-menu-wrap{ position:relative; flex-shrink:0; }
.top-menu-dropdown{
  position:absolute; top:calc(100% + 6px); right:0; z-index:220;
  min-width:210px; background:var(--card); border:1.5px solid var(--border);
  border-radius:14px; box-shadow:var(--shadow-lg); padding:6px;
  display:none; flex-direction:column; gap:2px;
}
.top-menu-dropdown.on{ display:flex; animation:fade .15s ease; }
.top-menu-item{
  width:100%; height:auto; border:none; background:transparent; color:var(--ink);
  border-radius:10px; padding:10px 12px; font-size:13.5px; font-weight:600;
  display:flex; align-items:center; justify-content:flex-start; gap:10px;
  position:relative; text-align:left; cursor:pointer;
}
.top-menu-item:hover, .top-menu-item:active{ background:var(--bg); }
.top-menu-item.active{ background:var(--mint-2); color:var(--teal); }
.top-menu-item .material-symbols-rounded{ font-size:20px; color:var(--teal); }
.top-menu-item.bell .dot{ position:static; margin-left:auto; }
.top-menu-cols{ cursor:default; }

/* company chips */
.chips{ display:flex; gap:7px; overflow-x:auto; padding:0 12px 9px;
  scrollbar-width:none; }
.chips::-webkit-scrollbar{ display:none; }
.chip{
  flex-shrink:0; padding:6px 14px; border-radius:999px; font-size:13px; font-weight:600;
  background:var(--card); border:1.5px solid var(--border); color:var(--muted);
  white-space:nowrap; transition:.15s;
}
.chip.on{ background:var(--teal); color:#fff; border-color:var(--teal); }

/* ---------- product grid + cards ------------------------------------------ */
.grid{ display:grid; gap:11px; grid-template-columns:repeat(var(--cols,1),minmax(0,1fr)); }
.grid.list-view{ grid-template-columns:1fr; }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.card{
  background:var(--card); border:1.5px solid rgba(30, 58, 138, 0.12);
  border-left: 4px solid var(--teal); border-radius:var(--r);
  padding:10px 10px 8px 10px; box-shadow:var(--shadow); position:relative;
  display:flex; flex-direction:column; gap:4px;
  min-height: 220px;
  /* Only animate the cheap, composited properties — "transition: all" forced
     iOS Safari to watch every property and made large grids janky. */
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.2s ease;
  /* iOS perf: let Safari skip layout/paint for off-screen cards in big catalogs
     (supported Safari 16.4+/Chrome; safely ignored on older browsers). */
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
  animation: cardFadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(30, 58, 138, 0.25);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.fav {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(15, 23, 42, 0.04);
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  z-index: 5;
}
.fav.on {
  background: var(--rose);
  color: #ffffff;
}
.fav:active {
  transform: scale(0.9);
}
.p-name{ font-weight:700; font-size:15px; padding-right:26px; line-height:1.25;
  min-height: 38px; overflow-wrap: anywhere; }
.p-comp{ font-size:12.5px; color:var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badges{ display:flex; flex-wrap:wrap; gap:5px; }
.pill{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; line-height:1.3; }
.pill.expiry{ background:#FFE4E6; color:var(--rose); }
.pill.stock-in{ background:#DCFCE7; color:#15803D; }
.pill.stock-out{ background:#FEE2E2; color:#B91C1C; }
.scheme-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.remark-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid;
  line-height: 1.2;
}
.co-tag{ font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:999px; }

.p-meta{ display:flex; flex-wrap:wrap; gap:4px 14px; font-size:12.5px; color:var(--ink); }
.p-meta b{ color:var(--ink); } .p-meta span{ color:var(--muted); }
.mrp{ font-weight:700; } .pts{ font-weight:700; color:var(--teal); }

/* qty inputs */
.qty-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin-top:auto; padding-top:6px; }
.qty{ display:flex; flex-direction:column; gap:3px; }
.qty label{ font-size:9px; font-weight:700; text-transform:uppercase;
  letter-spacing:.5px; color:var(--muted); text-align:center; }
.qty input{
  width:100%; text-align:center; padding:4px 2px; font-size:13px; font-weight:600;
  border:1.5px solid var(--border); border-radius:var(--r-sm); background:var(--bg); color:var(--ink);
}
.qty input:focus{ outline:none; border-color:var(--teal); background:var(--card); }
/* kill native spinners */
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.qty input[type=number]{ -moz-appearance:textfield; appearance:textfield; }

.p-total{
  display:flex; justify-content:space-between; align-items:center; margin-top:2px;
  padding-top:4px; border-top:1px dashed var(--border); font-size:12px;
}
.p-total .v{ font-weight:800; color:var(--blue); font-size:13.5px; }
/* Owner 07-Nov: keep the line's space when empty. display:none made the qty boxes
   jump when the first qty saved, so the next tap hit the card and opened the pop-up. */
/* owner 28-Nov: rep My POB */
.pob-top{ display:flex; gap:6px; margin-bottom:8px; align-items:center; }
.pob-sel{ font-size:12px; padding:6px 8px; border:1px solid var(--border, #e5e7eb); border-radius:8px; background:#fff; color:#1f2937; }
.pob-tabs{ display:flex; gap:6px; margin-bottom:8px; flex-wrap:wrap; }
.pob-tabs span{ font-size:11.5px; font-weight:800; padding:6px 10px; border-radius:14px; background:#e5e7eb; cursor:pointer; }
.pob-tabs span.on{ background:#0f766e; color:#fff; }
.pob-kpis{ display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:8px; }
.pob-kpi{ background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:8px; }
.pob-kt{ font-size:10px; color:#6b7280; font-weight:800; text-transform:uppercase; }
.pob-kv{ font-size:18px; font-weight:800; }
.pob-s{ font-size:11px; color:#6b7280; }
.pob-sub{ font-size:11px; font-weight:800; margin:6px 0 2px; }
.pob-bar{ height:8px; background:#e5e7eb; border-radius:6px; overflow:hidden; margin-bottom:8px; }
.pob-bar i{ display:block; height:100%; background:#16a34a; }
.pob-card{ background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:8px 10px; margin-bottom:8px; font-size:12px; }
.pob-h{ display:flex; justify-content:space-between; gap:6px; font-weight:800; font-size:13px; }
.pob-pill{ font-size:10px; font-weight:800; padding:2px 6px; border-radius:8px; color:#fff; white-space:nowrap; }
.pob-t{ border-collapse:collapse; width:100%; font-size:11.5px; margin-top:4px; background:#fff; }
.pob-t th, .pob-t td{ border-bottom:1px solid #e5e7eb; padding:5px 4px; text-align:left; vertical-align:top; }
.pob-t th{ color:#6b7280; font-size:10px; text-transform:uppercase; }
.pob-t .r{ text-align:right; white-space:nowrap; }
.pob-click{ cursor:pointer; }
.pob-note{ font-size:11px; color:#6b7280; margin:6px 0; }
.p-extra{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }   /* owner 29-Nov: two equal boxes */
.p-extra.hide{ display:none; }
.p-extra label{ display:flex; flex-direction:column; font-size:11px; font-weight:800; color:#7c3aed; gap:3px; min-width:0; white-space:nowrap; }
.p-extra input{ width:100%; min-width:0; padding:8px 10px; font-size:13px; border:1.5px solid #c4b5fd; border-radius:8px; background:#faf5ff; color:var(--ink, #1f2937); box-sizing:border-box; }
.p-total.empty{ visibility:hidden; padding:4px 0 0; }   /* undo generic .empty padding */
.p-total.empty > *, .p-total.empty > .material-symbols-rounded{ margin:0; }                        /* and generic .empty icon margin */

/* ---------- Quick Buy & List View Tables ----------------------------------- */
.quick-table-container { overflow:clip; margin-top:4px;   /* owner 29-Nov: clip (not auto) so the header can freeze */
  border-radius:12px; border:1px solid var(--border); box-shadow:var(--shadow); }
.quick-table {
  width: 100%; border-collapse:collapse;
  table-layout: fixed; background:var(--card);
}
.quick-table th, .quick-table td {
  padding: 5px 4px; font-size:13px; vertical-align:middle; text-align:center;   /* owner 29-Nov: tighter */
  border-bottom:1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quick-table th {
  position:sticky; top:-8px; background:var(--mint-2); color:var(--teal);   /* owner 29-Nov: frozen under top bar */
  font-size:11px; text-transform:uppercase; letter-spacing:.4px;
  border-bottom:2px solid var(--mint); z-index:1;
}
.quick-table th:first-child, .quick-table td:first-child { text-align:left; width: 46%; white-space: normal; }
.quick-table th:nth-child(2), .quick-table td:nth-child(2),
.quick-table th:nth-child(3), .quick-table td:nth-child(3),
.quick-table th:nth-child(4), .quick-table td:nth-child(4) { width: 11%; }
.quick-table th:nth-child(5), .quick-table td:nth-child(5) { width: 21%; white-space: normal !important; }

.quick-table .tot {
  font-weight: 800; color: var(--blue); background: #EFF6FF; border-radius: 8px;
  padding: 4px 6px; text-align: center; font-size: 11px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  line-height: 1.2; width: 100%; box-sizing: border-box;
}
.quick-table .tot.empty-tot {
  background: transparent;
  color: var(--muted);
  font-weight: normal;
}
.quick-table .tot .qbtot-qty {
  font-size: 11px;
  color: var(--ink);
  font-weight: 700;
}
.quick-table .tot .qbtot-val {
  font-size: 11px;
  color: var(--blue);
  font-weight: 800;
}
.quick-table input {
  width: 100%; min-width: 0; text-align: center; padding: 6px 2px;
  font-size: 15px; font-weight: 600; border: 1.5px solid var(--border);
  border-radius: 12px; background: var(--bg); color: var(--ink);
}
.quick-table input:focus { outline:none; border-color:var(--teal); background:var(--card); }
.quick-table input::-webkit-outer-spin-button, .quick-table input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.quick-table input[type=number] { -moz-appearance:textfield; appearance:textfield; }

.quick-table .tot {
  font-weight: 800; color: var(--blue); background: #EFF6FF; border-radius: 8px;
  padding: 4px 8px; text-align: center; white-space: nowrap; font-size:12.5px;
}
.qb-prod { display:flex; flex-direction:column; gap:1px; }
.qb-prod .nm { font-weight:700; display:flex; align-items:center; gap:5px; }
.qb-prod .cm { font-size:11px; color:var(--muted); overflow: hidden; text-overflow: ellipsis; }
.qb-prod .qb-sizes { font-weight:600; color:var(--ink); }
.qb-fav {
  border: none;
  background: rgba(15, 23, 42, 0.04);
  color: #cbd5e1;
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.2s ease;
}
.qb-fav.on {
  background: var(--rose);
  color: #ffffff;
}
.qb-fav:active {
  transform: scale(0.9);
}

/* ---------- cart ----------------------------------------------------------- */
.section-title{ font-size:17px; font-weight:700; margin:4px 2px 12px; }
.cart-item{
  background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  padding:11px 13px; box-shadow:var(--shadow); display:flex; gap:10px; align-items:flex-start;
  margin-bottom:10px;
}
.cart-item .ci-main{ flex:1; }
.cart-item .ci-name{ font-weight:700; font-size:14px; }
.cart-item .ci-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.cart-item .ci-qtytotal{ font-size:12.5px; color:var(--ink); margin-top:3px; }
.cart-item .ci-qtytotal b{ color:var(--teal); font-weight:800; }
.cart-item .ci-val{ font-weight:800; color:var(--blue); white-space:nowrap; }
.ci-del{ border:none; background:#FEF2F2; color:var(--rose); border-radius:8px;
  width:100%; height:36px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:13px; font-weight:600; gap:5px; margin-top:8px; }
/* cart inline qty edit row */
.cart-qty-row{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:8px; }
.cart-qty{ display:flex; flex-direction:column; gap:2px; }
.cart-qty label{ font-size:9px; font-weight:700; text-transform:uppercase;
  letter-spacing:.5px; color:var(--muted); text-align:center; }
.cart-qty input{
  width:100%; text-align:center; padding:5px 2px; font-size:14px; font-weight:600;
  border:1.5px solid var(--border); border-radius:var(--r-sm); background:var(--bg); color:var(--ink);
  touch-action:manipulation;
}
.cart-qty input:focus{ outline:none; border-color:var(--teal); background:var(--card); }
.cart-qty input::-webkit-outer-spin-button,
.cart-qty input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.cart-summary{ background:var(--card); border:1px solid var(--border); border-radius:var(--r);
  padding:14px; box-shadow:var(--shadow); margin-top:6px; }
.cart-summary .row{ display:flex; justify-content:space-between; padding:4px 0; font-size:14px; }
.cart-summary .row.grand{ font-size:18px; font-weight:800; border-top:1px solid var(--border);
  margin-top:6px; padding-top:10px; color:var(--teal); }
.remarks-input{ width:100%; padding:11px 13px; border-radius:var(--r-sm);
  border:1.5px solid var(--border); background:var(--bg); font-size:15px; color:var(--ink);
  resize:none; margin-top:12px; }
.remarks-input:focus{ outline:none; border-color:var(--teal); }
/* highlighted schemes box above the order button */
.cart-schemes{
  margin-top:14px; border:1.5px solid #F5D0A9; border-radius:var(--r);
  background:linear-gradient(135deg,#FFF7ED,#FEF3C7); overflow:hidden;
  box-shadow:0 2px 10px rgba(217,119,6,.12);
}
.cart-schemes .cs-title{
  display:flex; align-items:center; gap:7px; font-weight:800; font-size:13px;
  color:#B45309; padding:9px 13px; background:rgba(245,158,11,.16);
  text-transform:uppercase; letter-spacing:.4px;
}
.cart-schemes .cs-title .material-symbols-rounded{ font-size:18px; }
.cart-schemes .cs-row{
  display:flex; justify-content:space-between; gap:10px; align-items:flex-start;
  padding:8px 13px; border-top:1px dashed #F5D0A9; font-size:13px;
}
.cart-schemes .cs-prod{ font-weight:600; color:var(--ink); flex:1; }
.cart-schemes .cs-offer{ font-weight:800; color:#B45309; text-align:right; white-space:normal; }

.wa-btn{
  width:100%; padding:16px; background:var(--green); color:#fff; font-size:16px; font-weight:800;
  border-radius:var(--r); border:none; display:flex; align-items:center; justify-content:center; gap:10px;
  box-shadow:0 6px 20px rgba(37,211,102,.4); margin-top:14px;
}
.wa-btn:active{ transform:scale(.98); }
.wa-btn small{ display:block; font-size:11px; font-weight:500; opacity:.9; }

/* ---------- orders + more -------------------------------------------------- */
.order-card{
  background:var(--card); border:1.5px solid rgba(30, 58, 138, 0.12);
  border-left: 4px solid var(--amber); border-radius:var(--r);
  padding:13px 13px 13px 10px; box-shadow:var(--shadow); margin-bottom:10px;
  transition: all 0.2s ease;
}
.order-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.order-card .oc-top{ display:flex; justify-content:space-between; align-items:center; }
.order-card .o-no{ font-weight:700; font-size:13px; }
.order-card .o-date{ font-size:11px; color:var(--muted); }
.o-status{ font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px;
  background:var(--mint); color:var(--teal); }
.btn-row{ display:flex; gap:8px; margin-top:10px; }
.btn{ flex:1; padding:10px; border-radius:var(--r-sm); border:none; font-weight:700; font-size:13px;
  display:flex; align-items:center; justify-content:center; gap:6px; }
.btn.reorder{ background:#EFF6FF; color:var(--blue); border:1px solid #BFDBFE; }
.btn.wa{ background:var(--green); color:#fff; }
/* Owner 28-Nov: order buttons fit any phone width - icon on top, short label, 2 rows only when they cannot fit */
.oc-actions, .pro-lr-actions{ display:grid; grid-template-columns:repeat(auto-fit, minmax(64px, 1fr)); gap:6px; margin-top:10px; }
.oc-actions .btn, .pro-lr-actions .pro-lr-btn{ flex-direction:column; gap:2px; min-width:0; min-height:48px; padding:7px 2px;
  font-size:11.5px; font-weight:700; border-radius:10px; white-space:nowrap; overflow:hidden; }
.oc-actions .material-symbols-rounded{ font-size:19px; }
.oc-actions .lbl, .pro-lr-actions .lbl{ display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.btn.amb-cancel{ background:#fff; color:#B91C1C; border:1.5px solid #F87171; }

.more-card{
  background:var(--card); border:1.5px solid rgba(30, 58, 138, 0.12);
  border-left: 4px solid var(--teal); border-radius:var(--r);
  padding:16px 16px 16px 13px; box-shadow:var(--shadow); margin-bottom:12px;
}
.more-card h3{ margin:0 0 12px; font-size:15px; }
.stat-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.stat{ background:var(--mint-2); border:1px solid var(--mint); border-radius:var(--r-sm);
  padding:12px; text-align:center; }
.stat .n{ font-size:22px; font-weight:800; color:var(--teal); font-family:'Outfit'; }
.stat .l{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; }
.bar-row{ display:flex; align-items:center; gap:8px; margin:7px 0; font-size:12.5px; }
.bar-row .bl{ width:34%; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-track{ flex:1; height:18px; background:var(--bg); border-radius:6px; overflow:hidden; }
.bar-fill{ height:100%; background:linear-gradient(90deg,var(--teal),#14B8A6); border-radius:6px; }
.bar-val{ width:46px; text-align:right; font-weight:700; }
.setting-row{ display:flex; justify-content:space-between; align-items:center; padding:9px 0;
  border-bottom:1px solid var(--border); font-size:13px; }
.setting-row:last-child{ border-bottom:none; }
.mini-btn{ padding:7px 13px; border-radius:8px; border:1px solid var(--border);
  background:var(--bg); font-weight:600; font-size:12px; color:var(--ink); }

/* ---------- bottom nav ----------------------------------------------------- */
.botnav{
  position:fixed; bottom:0; left:0; right:0; z-index:50; height:var(--bot-h);
  background:var(--card); border-top:1px solid var(--border);
  display:flex; box-shadow:0 -2px 12px rgba(15,23,42,.06);
  padding-bottom:env(safe-area-inset-bottom);
}
.bnav{ flex:1; border:none; background:none; color:var(--muted);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  font-size:10.5px; font-weight:600; position:relative;
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.bnav .material-symbols-rounded{ font-size:23px; }
.bnav.on{ color:var(--teal); }
.bnav.on .material-symbols-rounded{ font-variation-settings:'FILL' 1,'wght' 600; }
.bnav .cart-count{ position:absolute; top:5px; right:calc(50% - 22px);
  background:var(--rose); color:#fff; font-size:9px; font-weight:800;
  min-width:16px; height:16px; border-radius:999px; display:none;
  align-items:center; justify-content:center; padding:0 4px; }
.bnav .cart-count.show{ display:flex; }

/* ---------- misc ----------------------------------------------------------- */
.empty{ text-align:center; padding:50px 20px; color:var(--muted); }
.empty .material-symbols-rounded{ font-size:46px; color:var(--border); display:block; margin-bottom:10px; }
.loader{ text-align:center; padding:40px; color:var(--muted); }
.spin{ width:34px; height:34px; border:3px solid var(--mint); border-top-color:var(--teal);
  border-radius:50%; animation:rot .8s linear infinite; margin:0 auto 12px; }
@keyframes rot{ to{ transform:rotate(360deg); } }

#toast-wrap{ position:fixed; bottom:calc(var(--bot-h) + 16px); left:0; right:0; z-index:100000;
  display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.toast{ background:var(--ink); color:#fff; padding:11px 18px; border-radius:999px; font-size:13px;
  font-weight:600; box-shadow:var(--shadow-lg); animation:tin .25s ease; max-width:90%; }
.toast.ok{ background:var(--teal); } .toast.err{ background:var(--rose); }
@keyframes tin{ from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:none; } }

.notice-bar{ background:linear-gradient(135deg,var(--teal),#0E8A90); color:#fff;
  padding:9px 14px; font-size:12.5px; display:flex; gap:8px; align-items:center; }
.notice-bar .material-symbols-rounded{ font-size:18px; }

/* ===================== ADMIN PORTAL REDESIGN ===================== */
body.admin { background: var(--bg); overflow-y: auto; position: static; height: auto; font-family: 'Inter', system-ui, sans-serif; color: var(--ink); }

/* Layout Grid Structure */
.adm-wrapper { display: flex; min-height: 100vh; position: relative; }

/* Sidebar Styling (Desktop) */
.adm-sidebar {
  width: 260px; background: var(--teal-d); color: #fff; display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; box-shadow: var(--shadow-lg);
  border-right: 1px solid rgba(255,255,255,0.08); transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 24px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-logo img { width: 42px; height: 42px; border-radius: var(--r-sm); object-fit: cover; }
.sidebar-brand .brand-text { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: 0.3px; color: #fff; }
.sidebar-brand .brand-text span { color: #93C5FD; font-weight: 600; }

.sidebar-nav { padding: 20px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: none;
  background: transparent; color: #E2E8F0; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  text-align: left; transition: all 0.2s ease; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.on { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.nav-item .material-symbols-rounded { font-size: 22px; opacity: 0.85; }
.nav-item.on .material-symbols-rounded { opacity: 1; }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.logout-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.2); background: transparent; color: #FCA5A5;
  border-radius: 10px; font-weight: 700; font-size: 14px; transition: all 0.2s ease;
}
.logout-btn:hover { background: rgba(239,68,68,0.1); color: #F87171; border-color: #F87171; }

/* Main Content Area Styling */
.adm-main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

/* Top Header Bar */
.adm-topbar {
  position: sticky; top: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle-btn {
  display: none; background: none; border: none; color: var(--ink); cursor: pointer;
  padding: 6px; border-radius: var(--r-sm); transition: background 0.2s;
}
.menu-toggle-btn:hover { background: var(--bg); }
.adm-page-title { margin: 0; font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: var(--teal); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 12px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.sync-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: livePulse 2s infinite ease-in-out;
}
@keyframes livePulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Content Padding */
.adm-content { padding: 24px; min-height: calc(100vh - 70px); }
.adm-pane { animation: fade 0.2s ease; }

/* Dashboard Styling */
.dash-overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 26px; }
.dash-stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.03);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: var(--card-accent, #2563EB);
  transition: height 0.2s ease;
}
.dash-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  border-color: rgba(30, 58, 138, 0.3);
}
.dash-stat-card:hover::before {
  height: 4.5px;
}
.dsc-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease;
}
.dash-stat-card:hover .dsc-icon {
  transform: scale(1.06);
}
.dsc-icon.blue { background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%); color: #2563EB; }
.dsc-icon.amber { background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%); color: #D97706; }
.dsc-icon.teal { background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 100%); color: #0D9488; }
.dsc-icon.purple { background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%); color: #7C3AED; }
.dsc-icon .material-symbols-rounded { font-size: 28px; }
.dsc-info { display: flex; flex-direction: column; min-width: 0; }
.dsc-info .n {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.6px;
}
.dsc-info .l {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

.dash-layout-row { display: flex; gap: 24px; margin-top: 8px; flex-wrap: wrap; }
.dash-col { display: flex; flex-direction: column; gap: 24px; }
.dash-col.main-col { flex: 1.7; min-width: 320px; }
.dash-col.side-col { flex: 1.3; min-width: 300px; }
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}
.dash-card h3 {
  margin: 0 0 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title-row h3 { margin: 0; }
.card-desc { font-size: 13.5px; color: var(--muted); margin: -10px 0 16px; }

/* Timeline Activity */
.timeline-container { position: relative; padding-left: 20px; border-left: 2px solid var(--border); margin-left: 10px; display: flex; flex-direction: column; gap: 20px; }
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: -27px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); border: 2.5px solid var(--card); box-shadow: 0 0 0 1.5px var(--border);
}
.timeline-dot.blue { background: #2563EB; box-shadow: 0 0 0 1.5px #BFDBFE; }
.timeline-dot.green { background: #10B981; box-shadow: 0 0 0 1.5px #A7F3D0; }
.timeline-dot.amber { background: #F59E0B; box-shadow: 0 0 0 1.5px #FDE68A; }
.timeline-dot.red { background: #EF4444; box-shadow: 0 0 0 1.5px #FCA5A5; }
.timeline-content { display: flex; flex-direction: column; gap: 2px; }
.timeline-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.timeline-header strong { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.timeline-time { font-size: 11px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.timeline-body { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* System Health Card */
.health-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.health-item:last-child { border-bottom: none; }
.health-item .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.health-item .dot.green { background: #10B981; box-shadow: 0 0 0 3px #D1FAE5; }
.health-item .dot.red { background: #EF4444; box-shadow: 0 0 0 3px #FEE2E2; }
.health-item .info { display: flex; flex-direction: column; gap: 2px; }
.health-item .info strong { font-size: 13.5px; font-weight: 700; }
.health-item .info span { font-size: 11.5px; color: var(--muted); }
.system-stats-box { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ss-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.ss-row span { color: var(--muted); }
.ss-row strong { color: var(--ink); font-weight: 600; }

/* Filter Bar Styling */
.adm-filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px; margin-bottom: 16px; align-items: center;
}
.adm-filter-bar .search-box { flex: 1; min-width: 200px; position: relative; }
.adm-filter-bar .search-box .material-symbols-rounded { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.adm-filter-bar .search-box input { width: 100%; padding: 8px 12px 8px 36px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14.5px; background: var(--bg); }
.adm-filter-bar .search-box input:focus { outline: none; border-color: var(--teal); background: var(--card); }
.adm-filter-bar .col-select { height: 38px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--card); font-size: 13px; font-weight: 600; padding: 0 8px; cursor: pointer; }

/* Tables Layout */
.adm-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; background: var(--card); }
.adm-table th { background: var(--bg); color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 2px solid var(--border); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.adm-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tbody tr:hover td { background: var(--mint-2); }
.small-table { font-size: 12.5px; }
.small-table th { padding: 8px 12px; }
.small-table td { padding: 8px 12px; }

/* Collapsible Party/Firm Groups */
.party-group-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.party-group-header {
  padding: 16px 20px; background: var(--card); display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; transition: background 0.15s;
}
.party-group-header:hover { background: var(--bg); }
.pgh-info { display: flex; align-items: center; gap: 12px; }
.pgh-chevron { transition: transform 0.2s ease; color: var(--muted); }
.party-group-card.open .pgh-chevron { transform: rotate(180deg); }
.party-group-title { font-size: 15px; font-weight: 700; color: var(--teal); display: flex; align-items: center; gap: 8px; }
.party-group-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.party-devices-body { display: none; padding: 16px; border-top: 1px solid var(--border); background: var(--bg); flex-direction: column; gap: 16px; }
.party-group-card.open .party-devices-body { display: flex; }

/* Device Detail Items inside Group */
.device-row-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 16px; box-shadow: var(--shadow); position: relative; margin-bottom: 8px;
}
.device-row-card.blocked { border-left: 4px solid var(--rose); }
.device-row-card.pending { border-left: 4px solid var(--amber); }
.device-row-card.approved { border-left: 4px solid var(--teal); }

.device-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.device-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.device-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px; font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.device-presets-row { display: flex; gap: 8px; margin: 12px 0; align-items: center; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.preset-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-right: 4px; }

/* Order list layout */
.adm-orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-card-inner { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; }

/* Status Badges */
.pc-badge { font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; }
.pc-badge.status-new { background: #EFF6FF; color: #1E40AF; border: 1.5px solid #DBEAFE; }
.pc-badge.status-accepted { background: #ECFDF5; color: #065F46; border: 1.5px solid #A7F3D0; }
.pc-badge.status-processing { background: #F5F3FF; color: #5B21B6; border: 1.5px solid #DDD6FE; }
.pc-badge.status-packed { background: #F0FDFA; color: #115E59; border: 1.5px solid #99F6E4; }
.pc-badge.status-partiallysupplied { background: #FFFBEB; color: #92400E; border: 1.5px solid #FDE68A; }
.pc-badge.status-outfordelivery { background: #EEF2FF; color: #3730A3; border: 1.5px solid #C7D2FE; }
.pc-badge.status-delivered { background: #F0FDF4; color: #166534; border: 1.5px solid #BBF7D0; }
.pc-badge.status-cancelled { background: #FEF2F2; color: #991B1B; border: 1.5px solid #FCA5A5; }

.pc-badge.email-sent { background: #ECFDF5; color: #065F46; border: 1.5px solid #A7F3D0; }
.pc-badge.email-failed { background: #FEF2F2; color: #991B1B; border: 1.5px solid #FCA5A5; }

/* SVG Chart Style */
.chart-container { display: flex; flex-direction: column; gap: 12px; padding: 8px 4px; }
.chart-bar-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.chart-bar-label { width: 35%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ink); }
.chart-bar-track { flex: 1; height: 22px; background: var(--bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.chart-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), #3B82F6); border-radius: 6px; transition: width 0.6s ease; }
.chart-bar-val { width: 60px; text-align: right; font-weight: 800; color: var(--teal); }

/* Settings Form Grid */
.settings-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 20px; }
.form-row-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.form-row-group .form-group { margin-bottom: 0; }
.resend-email-btn-group { display: flex; align-items: flex-end; height: 100%; }

/* Mobile Navigation Bar */
.adm-mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; height: var(--bot-h);
  background: var(--card); border-top: 1px solid var(--border); display: none;
  box-shadow: 0 -2px 12px rgba(15,23,42,.06); padding-bottom: env(safe-area-inset-bottom);
}
.adm-mobile-nav .mnav-item {
  flex: 1; border: none; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.adm-mobile-nav .mnav-item.on { color: var(--teal); }
.adm-mobile-nav .mnav-item .material-symbols-rounded { font-size: 24px; }
.adm-mobile-nav .mnav-item.on .material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 600; }

.more-nav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 4px; }
.mn-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
  font-size: 12.5px; font-weight: 700; color: var(--ink); text-align: center; transition: all 0.15s;
  cursor: pointer;
}
.mn-item:active { transform: scale(0.97); background: var(--mint-2); }
.mn-item .material-symbols-rounded { font-size: 28px; color: var(--teal); }
.mn-item.bad { color: var(--rose); border-color: #fca5a5; }
.mn-item.bad .material-symbols-rounded { color: var(--rose); }

/* Responsive adjustments */
@media (max-width: 991px) {
  .adm-sidebar { transform: translateX(-100%); width: 0; overflow: hidden; display: none; }
  .adm-main { margin-left: 0; padding-bottom: var(--bot-h); }
  .menu-toggle-btn { display: flex; }
  .adm-mobile-nav { display: flex; }
  .topbar-actions .mobile-only { display: flex; }
  .sync-status { display: none; }
}

@media (min-width: 992px) {
  body.admin .sheet-mask { display: none !important; }
}


/* Modal and Subtotal adjustment for Supplied vs Ordered */
.supplied-qty-diff { font-weight: 800; }
.supplied-qty-diff.less { color: #D97706; }
.supplied-qty-diff.equal { color: #059669; }
.supplied-qty-diff.more { color: #2563EB; }
.supplied-qty-diff.zero { color: var(--muted); }

.item-qty-input-col { display: flex; flex-direction: column; gap: 2px; }
.item-qty-input-col span { font-size: 9px; color: var(--muted); text-align: center; }

/* Admin card border highlighting */
.adm-card:hover {
  border-color: rgba(30, 58, 138, 0.45) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1) !important;
}
.adm-card {
  border: 1.5px solid rgba(30, 58, 138, 0.18) !important;
}

/* Adoption Metrics Box */
.metrics-list { display: flex; flex-direction: column; gap: 12px; }
.metric-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.metric-row:last-child { border-bottom: none; }
.metric-name { font-weight: 600; font-size: 13.5px; }
.metric-value { font-family: 'Outfit'; font-weight: 800; color: var(--teal); font-size: 15px; }

/* 360° Profile Tab Buttons & Panels */
.p-tab-btn {
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.p-tab-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}
.p-tab-btn.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* Timeline Custom Dot Colors */
.timeline-dot.blue { background-color: var(--blue) !important; }
.timeline-dot.amber { background-color: #d97706 !important; }
.timeline-dot.red { background-color: var(--rose) !important; }
.timeline-dot.green { background-color: #10b981 !important; } /* green */
.timeline-dot.purple { background-color: var(--violet) !important; }

.intel-pane {
  animation: fade 0.18s ease;
}

/* In-App Notifications Styling */
.notif-item {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}
.notif-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--teal);
}
.notif-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.notif-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 4px;
}
.notif-badge.info {
  background: rgba(14, 165, 233, 0.08);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.15);
}
.notif-badge.warn {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}
.notif-badge.success {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.notif-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.notif-item .nt {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  margin: 0;
}
.notif-item .nb {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin: 6px 0 0 0;
  word-break: break-word;
}

/* Quantity box mobile adjustments */
.qty input,
.quick-table input {
  font-size: 16px !important;
  touch-action: manipulation;
}

/* Stock Badges */
.stock-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px 2px 6px;
  border-radius: 4px 12px 12px 4px;
  display: inline-block;
  line-height: 1.3;
  margin-left: 6px;
  border: 1px solid transparent;
}
.stock-badge.stock-in {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
  border: 1px solid #bbf7d0;
  border-left: 3px solid #22c55e;
}
.stock-badge.stock-low {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
}
.stock-badge.stock-out {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-left: 3px solid #f43f5e;
}

/* Skeleton Loader */
.skeleton-card {
  background: var(--card);
  border: 1.5px solid rgba(30, 58, 138, 0.08);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.skeleton-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 20%, rgba(255,255,255,0.6) 60%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-line {
  height: 14px;
  background: var(--border);
  border-radius: 4px;
}
.skeleton-line.title {
  height: 18px;
  width: 70%;
}
.skeleton-line.subtitle {
  width: 50%;
}
.skeleton-line.badge {
  height: 20px;
  width: 30%;
  border-radius: 999px;
}
.skeleton-line.meta {
  width: 80%;
}
.skeleton-line.input {
  height: 38px;
  border-radius: var(--r-sm);
}

/* Custom Notifications Badges Mapping */
.notif-badge.general {
  background: rgba(100, 116, 139, 0.08);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.15);
}
.notif-badge.scheme {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.notif-badge.stock {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.15);
}
.notif-badge.alert {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ---------- Bottom Sheets (Notifications & Policies) ----------------------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 300;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.sheet-mask.on {
  visibility: visible;
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.18);
  z-index: 310;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 80vh;
  overflow-y: auto;
}
.sheet.on {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .sheet {
    max-width: 500px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
  }
}

/* ---------- Centered Popups (Past Order Details) --------------------------- */
.pop-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  backdrop-filter: blur(5px);
}
.pop-mask.on {
  visibility: visible;
  opacity: 1;
}
.pop-card {
  background: var(--card);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 1px solid var(--border);
}
.pop-mask.on .pop-card {
  transform: scale(1);
}

/* ---------- Filter Sheet & Options Styling ------------------------------- */

.filter-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 700;
}
.filter-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.filter-options-grid.select-grid {
  grid-template-columns: repeat(2, 1fr);
}
.filter-option-card {
  position: relative;
  cursor: pointer;
}
.filter-option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.filter-option-card .option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s ease;
  text-align: center;
  min-height: 42px;
}
.filter-option-card input[type="radio"]:checked + .option-label {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.12);
}
.filter-option-card:hover .option-label {
  border-color: var(--teal);
  background: var(--bg);
}
#filterBtn.active-filter {
  background: rgba(15, 118, 110, 0.12);
  border-color: var(--teal);
  color: var(--teal);
}

/* ============================================================================
   ADMIN MODALS  (Order editor, Request resolver, 360° Party Intel)
   These were previously undefined, so opening an order/request rendered the
   modal in normal page flow (it looked like "nothing opened"). This styles the
   .modal-backdrop overlay + .modal-card panel and their sub-elements.
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  /* display is toggled inline by JS (none <-> flex); these center it when shown */
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-card {
  background: var(--card);
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(15, 23, 42, 0.3));
  overflow: hidden;
  margin: auto;
  animation: fade 0.18s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}
.modal-header h2 { margin: 0; font-size: 16px; font-family: 'Outfit', 'Inter', sans-serif; }
.modal-body {
  padding: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--card);
  flex-shrink: 0;
}
.modal-card .close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 8px;
}
.modal-card .close-btn:hover { background: var(--bg); color: var(--ink); }

/* Modal content building blocks */
.order-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 13px;
  margin-bottom: 14px;
}
.order-details-grid > div { word-break: break-word; }
.remarks-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  min-height: 38px;
  color: var(--ink);
}
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
.admin-order-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-order-table th,
.admin-order-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  vertical-align: middle;
}
.admin-order-table thead th {
  background: var(--bg);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.admin-order-table input {
  width: 100%;
  max-width: 64px;
  padding: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  text-align: center;
}

/* Form controls used inside modals / settings */
.form-group { margin-bottom: 14px; }
.form-group > label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--ink);
}
.form-textarea { min-height: 72px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--teal);
}

/* Generic buttons used by admin modals (.btn-primary / .btn-secondary not scoped) */
.modal-footer .btn,
.modal-body .btn,
button.btn-primary, button.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
}
.modal-card .btn-primary, button.btn-primary {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.modal-card .btn-primary:active, button.btn-primary:active { transform: scale(.99); }

/* 360° Party Intel profile tabs row */
.profile-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .order-details-grid { grid-template-columns: 1fr; }
  .modal-card { max-height: 96vh; border-radius: 12px; }
}

/* ============================================================================
   ANALYTICS DASHBOARD (Reports pane) — toolbar, KPI strip, chart cards
   ============================================================================ */
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.range-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; background: var(--bg); padding: 4px; border-radius: 10px; }
.range-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.range-btn.on { background: var(--teal); color: #fff; }
.backup-widget { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.backup-status { font-size: 12px; color: var(--muted); font-weight: 600; }
.backup-status.ok { color: #059669; }
.backup-status.bad { color: var(--rose); }

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-card .kpi-n { font-family: 'Outfit', 'Inter', sans-serif; font-weight: 800; font-size: 22px; color: var(--ink); line-height: 1.1; }
.kpi-card .kpi-l { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.kpi-card .kpi-d { font-size: 11px; font-weight: 700; margin-top: 6px; }
.kpi-card .kpi-d.up { color: #059669; }
.kpi-card .kpi-d.down { color: var(--rose); }

/* Chart cards: fixed height box so Chart.js sizes correctly */
.chart-box { position: relative; height: 280px; width: 100%; }
.chart-box canvas { max-width: 100%; }
.report-card h3 { margin: 0 0 10px 0; font-size: 15px; }

/* Premium profile card styles */
.profile-card {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-d) 100%);
  color: #fff;
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
}
.profile-firm {
  font-size: 16px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1.25;
  margin-bottom: 3px;
}
.profile-meta {
  font-size: 12px;
  opacity: 0.85;
}
.profile-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  margin-top: 6px;
}

/* Premium Collapsible Sections */
.more-section {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.more-section:hover {
  border-color: rgba(30, 58, 138, 0.2);
}
.more-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--card);
  user-select: none;
}
.more-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
}
.more-section-title .material-symbols-rounded {
  font-size: 18px;
}
.more-section-body {
  padding: 0 16px 14px 16px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

/* Premium iOS Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}
input:checked + .slider {
  background-color: var(--teal);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.switch.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Active Tap/Click micro-animations */
.card:active, .chip:active, .bnav:active, .ctrl-btn:active, button:active, .btn-primary:active, .btn-secondary:active, .btn:active {
  transform: scale(0.97) !important;
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Floating Quick Order Action Button */
.fab-quick-order {
  position: fixed;
  bottom: 74px;
  right: 16px;
  background: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(15,118,110,0.35);
  cursor: pointer;
  z-index: 95;
  transition: transform 0.2s, box-shadow 0.2s, padding 0.25s ease, width 0.25s ease, height 0.25s ease;
}
/* A slim tab on the screen edge: a round button here sat on the Case box of the right column. */
.fab-quick-order.compact {
  padding: 0;
  right: 0;
  width: 20px;
  height: 56px;
  border-radius: 12px 0 0 12px;
  justify-content: center;
  gap: 0;
  font-size: 13px;
  overflow: hidden;
}
.fab-quick-order.compact .fab-full-part {
  display: none;
}
.fab-quick-order:active { transform: scale(0.95); }

/* Near Expiry Card Styles */
.near-exp-card {
  display: flex;
  flex-direction: column;
}
.near-exp-batches {
  display: flex;
  flex-direction: column;
  margin: 6px 0;
}
.near-exp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}
/* EXP + stock on its own line, qty boxes full width below — side by side they
   squeezed the EXP badge under the STRIPS/BOX labels on narrow cards */
.near-exp-row { flex-wrap: wrap; }
.near-exp-row > div:first-child { flex: 1 1 100% !important; }
.near-exp-row > .qty-row { flex: 1 1 100%; justify-content: stretch !important; }
.near-exp-row > .qty-row > * { flex: 1; }
.near-exp-row .pill.expiry { white-space: nowrap; }
.near-exp-row:first-child {
  border-top: 1px dashed var(--border);
}
.near-exp-remark-container {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.near-exp-remark-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s ease;
}
.near-exp-remark-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.near-exp-remark-btn.has-remark {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
  font-weight: 700;
}
.near-exp-remark-box {
  margin-top: 6px;
}

/* ============================================================================
   E-COMMERCE HOME TAB, HERO CAROUSEL & LIVE DISPATCH CAPSULE STYLES
   ============================================================================ */
/* ============================================================================
   PROFESSIONAL LR & DISPATCH TRACKING CARD
   ============================================================================ */
.pro-lr-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.pro-lr-card.compact {
  padding: 12px 14px;
}

/* Card Header */
.pro-lr-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.pro-lr-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pro-lr-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pro-lr-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #059669;
  font-size: 16px;
}

.pro-lr-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.2px;
}

.pro-lr-subtitle {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.pro-lr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.pro-lr-status-pill.warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.pro-lr-status-pill.info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.pro-lr-status-pill .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse-green 1.8s infinite;
}

.pro-lr-status-pill.warning .pulse-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

@keyframes pulse-green {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes pro-spin {
  to { transform: rotate(360deg); }
}

/* Stepper Progress Bar */
.pro-lr-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  margin: 12px 0 16px 0;
  padding: 0 4px;
}

.pro-lr-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.pro-lr-step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #94a3b8;
  border: 2px solid #cbd5e1;
  transition: all 0.2s ease;
}

.pro-lr-step.done .pro-lr-step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.pro-lr-step.active .pro-lr-step-circle {
  background: #0d9488;
  border-color: #0d9488;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.pro-lr-step-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
}

.pro-lr-step.done .pro-lr-step-label,
.pro-lr-step.active .pro-lr-step-label {
  color: #0f172a;
  font-weight: 700;
}

.pro-lr-step-line {
  position: absolute;
  top: 12px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
}

.pro-lr-step-line-fill {
  height: 100%;
  background: #10b981;
  transition: width 0.3s ease;
}

/* Transporter & LR Docket Box */
.pro-lr-docket {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.pro-lr-trans-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}

.pro-lr-trans-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pro-lr-trans-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  white-space: nowrap;
}

/* Big LR Highlight Block */
.pro-lr-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid #0d9488;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.pro-lr-num-group {
  display: flex;
  flex-direction: column;
}

.pro-lr-num-label {
  font-size: 9.5px;
  font-weight: 800;
  color: #0d9488;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pro-lr-num-val {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pro-lr-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pro-lr-copy-btn:active {
  transform: scale(0.96);
  background: #bbf7d0;
}

.pro-lr-pending-lr {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
}

/* Grid of Meta Info */
.pro-lr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  font-size: 11.5px;
  color: #334155;
}

.pro-lr-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pro-lr-cell-label {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.pro-lr-cell-val {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

/* Actions Bottom Row (owner 28-Nov: grid, see .oc-actions) */
.pro-lr-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.pro-lr-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.pro-lr-btn-primary {
  background: #0f766e;
  color: #ffffff;
}

.pro-lr-btn-primary:active {
  background: #115e59;
}

.pro-lr-btn-sec {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.pro-lr-btn-sec:active {
  background: #e2e8f0;
}

.pro-lr-btn-wa {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}

.pro-lr-btn-wa:active {
  background: #dcfce7;
}

/* Backward compatibility aliases */
.home-dispatch-capsule, .home-dispatch-search-box {
  display: block;
}

/* Hero Carousel */
.home-hero-wrap {
  position: relative;
  margin-bottom: 16px;
}
.home-carousel-arrow {
  position: absolute;
  top: calc(50% - 18px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  user-select: none;
}
.home-carousel-arrow:hover {
  background: #ffffff;
  transform: scale(1.1);
}
.home-carousel-arrow.prev { left: 8px; }
.home-carousel-arrow.next { right: 8px; }
.home-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 18px;
}
.home-carousel::-webkit-scrollbar { display: none; }
.home-hero-slide {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: start;
  border-radius: 18px;
  padding: 18px 20px;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: transform 0.2s ease;
  background-size: cover;
  background-position: center;
}
.home-hero-slide:active { transform: scale(0.98); }
.home-hero-slide .hhs-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-hero-slide.has-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,23,42,.72) 0%, rgba(15,23,42,.15) 75%); }
.hhs-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; }
.hhs-badge {
  padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; background: #FBBF24; color: #78350F; margin-bottom: 4px;
}
.hhs-title { font-family: 'Outfit','Inter',sans-serif; font-size: 18px; font-weight: 800; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.hhs-sub { font-size: 12.5px; opacity: .92; line-height: 1.35; max-width: 90%; }
.hhs-btn { margin-top: auto; padding: 5px 12px; border-radius: 20px; background: #fff; color: var(--ink); font-size: 11.5px; font-weight: 800; }
.home-carousel-dots { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 8px; }
.home-dot { width: 6px; height: 6px; border-radius: 50%; background: #CBD5E1; transition: all .25s ease; cursor: pointer; }
.home-dot.on { width: 18px; border-radius: 10px; background: var(--teal); }

/* Home Section Layout */
.home-section {
  margin-top: 20px;
}
.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.home-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-see-all {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
}

/* Quick Circles */
.home-quick-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}
.home-quick-grid::-webkit-scrollbar { display: none; }
.home-quick-item {
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
}
.hqi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.home-quick-item:active .hqi-icon { transform: scale(0.92); }
.hqi-icon.teal { background: #F0FDFA; color: #0D9488; border-color: #CCFBF1; }
.hqi-icon.purple { background: #FAF5FF; color: #9333EA; border-color: #F3E8FF; }
.hqi-icon.rose { background: #FFF1F2; color: #E11D48; border-color: #FFE4E6; }
.hqi-icon.amber { background: #FFFBEB; color: #D97706; border-color: #FEF3C7; }
.hqi-icon.blue { background: #EFF6FF; color: #2563EB; border-color: #DBEAFE; }
.home-quick-item span {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* Deal Shelf (Horizontal) */
.home-shelf-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px 8px 2px;
}
.home-shelf-scroll::-webkit-scrollbar { display: none; }
.home-deal-card {
  min-width: 165px;
  max-width: 185px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.hdc-badge, .home-deal-card .deal-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  background: #F3E8FF;
  color: #7E22CE;
}
.hdc-company {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 700;
  text-transform: uppercase;
}
.hdc-name, .home-deal-card .p-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 3px 0 2px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hdc-pack, .home-deal-card .p-meta {
  font-size: 11px;
  color: var(--muted);
}
.hdc-price-row, .home-deal-card .bottom-row {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hdc-price, .home-deal-card .price {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--teal);
}
.hdc-mrp {
  font-size: 11px;
  color: var(--muted);
  text-decoration: line-through;
}
.hdc-add-btn {
  margin-top: 8px;
  width: 100%;
  padding: 6px 0;
  border-radius: 8px;
  border: 1px solid var(--teal);
  background: #F0FDF4;
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.hdc-add-btn:hover {
  background: var(--teal);
  color: #fff;
}

/* Buy Again List */
.home-buy-again-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-buy-item, .home-buy-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  gap: 10px;
}
.hbi-icon { font-size: 20px; }
.hbi-info { flex: 1; }
.hbi-name, .home-buy-card .name { font-size: 13px; font-weight: 700; color: var(--ink); }
.hbi-meta, .home-buy-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.hbi-action { display: flex; align-items: center; }

/* Brands Grid */
.home-brands-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px;
}
.home-brands-grid::-webkit-scrollbar { display: none; }
.home-brand-card, .home-brand-chip {
  min-width: 135px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.home-brand-card:hover, .home-brand-chip:hover {
  border-color: var(--teal);
  background: #F0FDF4;
}
.hbc-icon { font-size: 16px; }
.hbc-name { font-size: 12px; font-weight: 700; color: var(--ink); }

/* ============================================================================
   ADMIN — primitives admin.js emits (were missing → raw checkboxes, bare badges)
   ============================================================================ */
.pc-badge.ok   { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.pc-badge.wait { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.pc-badge.bad  { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; transition: background .15s, border-color .15s; }
.mini-btn:hover { border-color: #CBD5E1; background: var(--card); }
.mini-btn:disabled { opacity: .5; cursor: not-allowed; }
.mini-btn .material-symbols-rounded { font-size: 16px; }
.mini-btn.text { background: none; border-color: transparent; }
.mini-btn.text:hover { background: var(--mint-2); }
.mini-btn.ok { background: #059669; border-color: #059669; color: #fff; }
.mini-btn.bad, .mini-btn.danger { color: var(--rose); border-color: #FECDD3; background: #FFF1F2; }

/* switch */
.tgl { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 0; font-size: 13px; position: relative; }
.tgl input { position: absolute; opacity: 0; width: 0; height: 0; }
.tgl-sw { flex: 0 0 auto; width: 36px; height: 20px; border-radius: 20px; background: #CBD5E1; position: relative; transition: background .15s; }
.tgl-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.tgl input:checked + .tgl-sw { background: #059669; }
.tgl.danger input:checked + .tgl-sw { background: var(--rose); }
.tgl input:checked + .tgl-sw::after { transform: translateX(16px); }
.tgl input:focus-visible + .tgl-sw { outline: 2px solid var(--blue); outline-offset: 2px; }
.tgl input:disabled + .tgl-sw { opacity: .45; }
.tgl:has(input:disabled) { cursor: not-allowed; color: var(--muted); }

/* ---------- Devices & Parties ---------- */
.party-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pstat { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pstat b { font-family: 'Outfit',sans-serif; font-size: 18px; color: var(--ink); }
.pstat.on { border-color: var(--teal); background: var(--mint-2); color: var(--teal); }
.pstat.warn b { color: #B45309; }
.pstat.alert b { color: var(--rose); }
.party-group-header { gap: 12px; flex-wrap: wrap; padding: 14px 16px; }
.pgh-info { min-width: 0; flex: 1; }
.p-avatar { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: 'Outfit',sans-serif; font-weight: 800; font-size: 15px; }
.party-group-title { flex-wrap: wrap; }
.party-group-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.party-group-sub a { color: var(--teal); text-decoration: none; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.party-group-sub .material-symbols-rounded { font-size: 15px; }
.pgh-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.label-chip { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #F1F5F9; color: #475569; }
.party-devices-body { gap: 12px; }
.device-row-card { padding: 14px 16px; margin-bottom: 0; }
.device-header { align-items: center; margin-bottom: 4px; }
.device-title { flex-wrap: wrap; }
.device-meta { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.dev-setup { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; gap: 12px 16px; align-items: end; padding: 12px; background: var(--bg); border-radius: var(--r-sm); margin: 10px 0; }
.cap { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.dev-setup select { width: 100%; padding: 8px 10px; font-size: 13px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--card); }
.dev-setup select.need { border-color: #F59E0B; background: #FFFBEB; }
.preset-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.perm-master { border-bottom: 1px dashed var(--border); margin-bottom: 6px; padding-bottom: 6px; font-weight: 800; color: var(--teal); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 24px; }
.dev-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.dev-foot input { width: 100%; padding: 8px 10px; font-size: 12.5px; }
.dev-tech { margin-top: 10px; font-size: 12px; color: var(--muted); }
.dev-tech summary { cursor: pointer; font-weight: 600; }
.dev-tech .device-details-grid { margin: 8px 0 0; }
.sibling-box { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; border-radius: 8px; padding: 10px 14px; margin: 8px 0; font-size: 12.5px; line-height: 1.45; }
.sibling-box.ok { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.sibling-box .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Home Banners studio ---------- */
.promo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.promo-side { position: sticky; top: 90px; }
.promo-form { display: flex; flex-direction: column; gap: 14px; }
.promo-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.promo-form .form-group { margin: 0; }
.promo-form .hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.opt { font-weight: 500; color: var(--muted); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 34px; height: 34px; border-radius: 10px; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--border); }
.swatches input:checked + span { border-color: #fff; box-shadow: 0 0 0 2px var(--teal); }
.swatches input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.promo-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--border); padding-top: 14px; }
.promo-actions .tgl { margin-right: auto; font-weight: 600; }
.promo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.promo-item { border: 1.5px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--card); }
.promo-item.editing { border-color: var(--teal); box-shadow: 0 0 0 3px var(--mint); }
.promo-item.off .home-hero-slide { filter: grayscale(.85); opacity: .55; }
.promo-item .home-hero-slide { border-radius: 0; box-shadow: none; min-height: 120px; padding: 14px 16px; cursor: default; }
.promo-item .home-hero-slide:active, .phone .home-hero-slide:active { transform: none; }
.promo-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 12px; }
.promo-item-foot .tgt { font-size: 11.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-item-foot .tgt b { color: var(--ink); }
.promo-item-foot .btns { display: flex; gap: 2px; flex: 0 0 auto; }
.promo-empty { text-align: center; padding: 28px 12px; color: var(--muted); border: 1.5px dashed var(--border); border-radius: var(--r); font-size: 13px; }

/* phone mock — renders the real app slide CSS inside */
.phone { width: 300px; margin: 0 auto; background: #0F172A; border-radius: 40px; padding: 10px; box-shadow: 0 24px 48px -18px rgba(15,23,42,.45); }
.phone-screen { background: var(--bg); border-radius: 30px; overflow: hidden; height: 540px; display: flex; flex-direction: column; }
.phone-status { height: 30px; flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-size: 11px; font-weight: 700; color: var(--ink); background: var(--card); }
.phone-notch { width: 76px; height: 18px; background: #0F172A; border-radius: 12px; }
.phone-head { padding: 6px 12px 10px; background: var(--card); border-bottom: 1px solid var(--border); }
.fake-search { height: 32px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.fake-search .material-symbols-rounded { font-size: 16px; }
.phone-body { flex: 1; padding: 12px; overflow: hidden; }
.phone-skel { height: 58px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); margin-top: 10px; }
.phone-nav { display: flex; justify-content: space-around; padding: 8px 0 14px; background: var(--card); border-top: 1px solid var(--border); font-size: 9.5px; color: var(--muted); }
.phone-nav span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.phone-nav .material-symbols-rounded { font-size: 20px; }
.phone-nav .on { color: var(--teal); font-weight: 700; }
.tap-hint { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--mint-2); color: var(--teal); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.tap-hint .material-symbols-rounded { font-size: 18px; }

@media (max-width: 1180px) {
  .promo-layout { grid-template-columns: 1fr; }
  .promo-side { position: static; order: -1; }
}
@media (max-width: 640px) {
  .promo-form .row2, .dev-setup { grid-template-columns: 1fr; }
  .phone-screen { height: 400px; }
  .adm-content { padding: 14px; }
}




/* owner 29-Nov: qty + value line on top of the product card, above the name */
.p-total.top{ margin:0 46px 6px 0; min-height:22px; padding:0 0 4px; border-top:0; border-bottom:1px dashed var(--border); }
