/* ============ A2YMART SHARED STYLES ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --orange: #1034a6;
  --orange-dark: #0b2478;
  --orange-light: #edf1fd;
  --dark: #16161a;
  --gray: #757575;
  --bg: #f5f5f5;
  --white: #ffffff;
  --green: #26aa99;
  --red: #e02020;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0,0,0,.08);
}
body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #222;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }

/* ---------- TOP BAR ---------- */
.topbar {
  background: linear-gradient(100deg, var(--orange) 0%, #3b5fd9 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(16,52,166,.35);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.logo {
  font-size: 26px; font-weight: 800; letter-spacing: -1px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.logo .bag { font-size: 28px; }
.logo em { font-style: normal; color: #c8d6f7; }
.logo-img {
  height: 48px; width: auto; display: block;
  border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.searchbox {
  flex: 1; min-width: 200px; display: flex; background: #fff;
  border-radius: 4px; overflow: hidden;
}
.searchbox input {
  flex: 1; border: none; padding: 10px 14px; font-size: 14px; outline: none;
}
.searchbox button {
  background: var(--orange-dark); color: #fff; padding: 0 20px; font-size: 16px;
}
.cart-btn {
  position: relative; background: rgba(255,255,255,.15); color: #fff;
  border-radius: 8px; padding: 9px 16px; font-size: 20px;
  transition: background .2s;
}
.cart-btn:hover { background: rgba(255,255,255,.3); }
.cart-count {
  position: absolute; top: -6px; right: -6px; background: #fff;
  color: var(--orange); font-size: 11px; font-weight: 800;
  border-radius: 10px; padding: 2px 6px; border: 2px solid var(--orange);
}
.owner-link {
  font-size: 12px; opacity: .9; background: rgba(0,0,0,.18);
  padding: 8px 12px; border-radius: 8px;
}
.owner-link:hover { background: rgba(0,0,0,.32); }

/* ---------- LIVE BADGE ---------- */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  font-weight: 700; padding: 4px 10px; border-radius: 20px;
}
.live-badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.live-on { background: rgba(38,170,153,.15); color: var(--green); }
.live-on .dot { background: var(--green); animation: pulse 1.4s infinite; }
.live-off { background: rgba(255,255,255,.2); color: #fff; }
.live-off .dot { background: #ffd76e; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ---------- LAYOUT ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.section-title {
  font-size: 15px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: 1px; margin: 22px 0 12px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- CATEGORIES ---------- */
.cat-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px,1fr));
  gap: 10px; background: #fff; padding: 16px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cat-item {
  text-align: center; padding: 12px 6px; border-radius: 8px;
  cursor: pointer; transition: all .15s; border: 2px solid transparent;
}
.cat-item:hover { background: var(--orange-light); transform: translateY(-2px); }
.cat-item.active { border-color: var(--orange); background: var(--orange-light); }
.cat-item .ico { font-size: 30px; }
.cat-item .nm { font-size: 11px; margin-top: 6px; color: #444; font-weight: 600; }

/* ---------- PRODUCT GRID ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 14px;
}
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.13); }
.card-img {
  height: 150px; background: linear-gradient(135deg,#dbe4fa,#eef2fc);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.card-name { font-size: 14px; font-weight: 600; line-height: 1.3; min-height: 36px; }
.card-cat { font-size: 11px; color: var(--gray); margin: 4px 0; }
.card-price { font-size: 17px; font-weight: 800; color: var(--orange); }
.card-time {
  font-size: 11px; color: var(--gray); margin: 4px 0 8px;
  display: flex; align-items: center; gap: 4px;
}
.card-stock { font-size: 11px; color: var(--green); font-weight: 600; }
.card-stock.out { color: var(--red); }
.add-btn {
  margin-top: auto; background: var(--orange); color: #fff;
  padding: 9px; border-radius: 6px; font-weight: 700; font-size: 13px;
  transition: background .15s;
}
.add-btn:hover { background: var(--orange-dark); }
.add-btn:disabled { background: #ccc; cursor: not-allowed; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--gray);
  background: #fff; border-radius: var(--radius);
}
.empty .big { font-size: 50px; }

/* ---------- CART DRAWER ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 92vw;
  height: 100%; background: #fff; z-index: 201; transition: right .25s;
  display: flex; flex-direction: column; box-shadow: -4px 0 20px rgba(0,0,0,.2);
}
.drawer.open { right: 0; }
.drawer-head {
  padding: 16px; background: var(--orange); color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 17px;
}
.drawer-head button { background: none; color: #fff; font-size: 22px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.cart-row {
  display: flex; gap: 10px; align-items: center; padding: 10px;
  border-bottom: 1px solid #eee;
}
.cart-row .thumb {
  width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg,#dbe4fa,#eef2fc);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  overflow: hidden;
}
.cart-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .info { flex: 1; }
.cart-row .info .n { font-size: 13px; font-weight: 600; }
.cart-row .info .p { font-size: 13px; color: var(--orange); font-weight: 700; }
.qty-controls { display: flex; align-items: center; gap: 6px; }
.qty-controls button {
  width: 26px; height: 26px; border-radius: 6px; background: var(--orange-light);
  color: var(--orange); font-weight: 800; font-size: 15px;
}
.qty-controls span { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.remove-x { background: none; color: var(--red); font-size: 17px; }
.drawer-foot { padding: 16px; border-top: 1px solid #eee; }
.total-row {
  display: flex; justify-content: space-between; font-size: 17px;
  font-weight: 800; margin-bottom: 12px;
}
.total-row span:last-child { color: var(--orange); }
.checkout-btn {
  width: 100%; background: var(--orange); color: #fff; padding: 13px;
  border-radius: 8px; font-size: 15px; font-weight: 800;
}
.checkout-btn:hover { background: var(--orange-dark); }

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 440px; max-width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 24px;
  animation: popIn .2s;
}
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin-bottom: 14px; font-size: 19px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: #555; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid #ddd; border-radius: 8px;
  font-size: 14px; outline: none; transition: border .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); }
.btn {
  padding: 11px 18px; border-radius: 8px; font-weight: 700; font-size: 14px;
}
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-gray { background: #eee; color: #444; }
.btn-block { width: 100%; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ---------- TOAST ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--dark); color: #fff; padding: 12px 22px; border-radius: 30px;
  font-size: 14px; font-weight: 600; z-index: 500; transition: transform .3s;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- LOGIN PAGE ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16161a 0%, #0a1230 60%, #1034a6 160%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 18px; padding: 40px 34px; width: 400px;
  max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.4); text-align: center;
}
.login-card .logo-big { font-size: 40px; }
.login-card h1 { font-size: 24px; margin: 8px 0 4px; }
.login-card h1 em { font-style: normal; color: var(--orange); }
.login-card p { color: var(--gray); font-size: 13px; margin-bottom: 22px; }
.login-card input {
  width: 100%; padding: 13px 14px; border: 2px solid #eee; border-radius: 10px;
  font-size: 15px; outline: none; margin-bottom: 12px; text-align: center;
  letter-spacing: 2px;
}
.login-card input:focus { border-color: var(--orange); }
.login-err { color: var(--red); font-size: 13px; font-weight: 600; min-height: 18px; margin-bottom: 6px; }
.shake { animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

/* ---------- OWNER DASHBOARD ---------- */
.owner-topbar { background: var(--dark); }
.owner-topbar .logo em { color: var(--orange); }
.tabs {
  display: flex; gap: 6px; background: #fff; padding: 8px; border-radius: 12px;
  box-shadow: var(--shadow); margin-bottom: 18px; flex-wrap: wrap;
}
.tab {
  flex: 1; min-width: 110px; padding: 11px 6px; border-radius: 8px; background: none;
  font-weight: 700; font-size: 13px; color: #666; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab:hover { background: var(--orange-light); color: var(--orange); }
.tab.active { background: var(--orange); color: #fff; }
.tab .badge {
  background: var(--red); color: #fff; font-size: 10px; padding: 2px 7px;
  border-radius: 10px; font-weight: 800;
}
.tab.active .badge { background: #fff; color: var(--orange); }

.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
  border-left: 4px solid var(--orange);
}
.stat .num { font-size: 26px; font-weight: 800; }
.stat .lbl { font-size: 12px; color: var(--gray); font-weight: 600; }

.panel { background: #fff; border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.panel-head h2 { font-size: 17px; }

/* owner product list */
.prod-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid #eee; border-radius: 10px; margin-bottom: 10px;
}
.prod-row .thumb {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg,#dbe4fa,#eef2fc);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  overflow: hidden;
}
.prod-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-row .meta { flex: 1; }
.prod-row .meta .n { font-weight: 700; font-size: 14px; }
.prod-row .meta .sub { font-size: 12px; color: var(--gray); }
.prod-row .price { font-weight: 800; color: var(--orange); }
.icon-btn { background: #f2f2f2; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.icon-btn:hover { background: #e5e5e5; }
.icon-btn.danger { background: #fdecec; color: var(--red); }
.icon-btn.danger:hover { background: #f9d4d4; }

/* orders */
.order-card {
  border: 1px solid #eee; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  border-left: 5px solid #f5a623;
}
.order-card.done { border-left-color: var(--green); opacity: .8; }
.order-card.new { border-left-color: var(--red); background: #fffaf8; }
.order-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.order-head .who { font-weight: 800; font-size: 15px; }
.order-time { font-size: 12px; color: var(--gray); }
.order-items { font-size: 13px; color: #444; margin: 6px 0; }
.order-items li { margin-left: 18px; margin-bottom: 2px; }
.order-total { font-weight: 800; color: var(--orange); }
.status-pill {
  font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px;
  text-transform: uppercase;
}
.status-pending { background: #fff3d6; color: #b07b00; }
.status-done { background: #d9f2ee; color: var(--green); }
.order-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- TEAM ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 14px; }
.member-card {
  border-radius: 14px; padding: 20px 16px; text-align: center; color: #fff;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.member-card.owner { background: linear-gradient(145deg,#1b1b20,#000); border: 1px solid #333; }
.member-card.agent { background: linear-gradient(145deg,#e02020,#8e0b0b); }
.member-card .avatar {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  font-weight: 800; background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.35);
}
.member-card .m-name { font-weight: 800; font-size: 16px; }
.member-card .m-title { font-size: 12px; opacity: .8; margin-top: 3px; }
.role-tag {
  display: inline-block; margin-top: 10px; font-size: 10px; font-weight: 800;
  letter-spacing: 1.5px; padding: 4px 12px; border-radius: 20px;
  background: rgba(255,255,255,.18); text-transform: uppercase;
}
.member-card .del-member {
  position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.15);
  color: #fff; border-radius: 8px; width: 28px; height: 28px; font-size: 13px;
}
.member-card .del-member:hover { background: rgba(255,255,255,.35); }

/* join banner on shop */
.join-banner {
  margin-top: 26px; background: linear-gradient(120deg, var(--dark), #0c1638);
  color: #fff; border-radius: 14px; padding: 26px; display: flex;
  justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.join-banner h3 { font-size: 20px; }
.join-banner h3 em { font-style: normal; color: var(--orange); }
.join-banner p { font-size: 13px; opacity: .8; margin-top: 4px; }

footer { text-align: center; padding: 30px 16px; color: var(--gray); font-size: 12px; }

/* ---------- THEME TOGGLE BUTTON ---------- */
.theme-btn {
  background: rgba(255,255,255,.15); color: #fff; border-radius: 8px;
  padding: 9px 13px; font-size: 17px; transition: background .2s;
}
.theme-btn:hover { background: rgba(255,255,255,.3); }

/* ---------- SIGN IN ---------- */
.signin-btn {
  background: rgba(0,0,0,.18); color: #fff; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700;
}
.signin-btn:hover { background: rgba(0,0,0,.32); }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.18);
  border-radius: 20px; padding: 5px 6px 5px 14px; font-size: 13px; font-weight: 700;
  color: #fff;
}
.user-chip .out {
  background: rgba(255,255,255,.2); color: #fff; border-radius: 14px;
  padding: 4px 10px; font-size: 11px; font-weight: 700;
}
.user-chip .out:hover { background: rgba(255,255,255,.4); }

/* ---------- RECEIPT ---------- */
.receipt {
  background: #fff; color: #111; width: 320px; max-width: 100%;
  margin: 0 auto; padding: 22px 20px; font-family: 'Courier New', monospace;
  font-size: 13px; border-radius: 4px;
}
.receipt .r-center { text-align: center; }
.receipt .r-logo { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.receipt .r-sub { font-size: 11px; color: #555; margin-top: 2px; }
.receipt .r-dash { border-top: 1px dashed #999; margin: 10px 0; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; }
.receipt .r-row .l { flex: 1; }
.receipt .r-total { font-weight: 800; font-size: 15px; }
.receipt .r-small { font-size: 11px; color: #555; }
#receiptModal .modal { width: 380px; }

@media print {
  body * { visibility: hidden !important; }
  #receiptModal, #receiptModal * { visibility: visible !important; }
  #receiptModal { position: absolute !important; inset: 0 !important; background: #fff !important; display: block !important; padding: 0 !important; }
  #receiptModal .modal { box-shadow: none !important; width: 100% !important; max-height: none !important; padding: 0 !important; animation: none !important; }
  #receiptModal .no-print { display: none !important; }
  .receipt { width: 100%; }
}

/* ---------- PACKAGE TRACKING ---------- */
.track-btn {
  background: rgba(255,255,255,.15); color: #fff; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; transition: background .2s;
}
.track-btn:hover { background: rgba(255,255,255,.3); }
#trackModal .modal { width: 520px; }

.track-order {
  border: 1px solid #eee; border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.track-order .t-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 6px; margin-bottom: 4px;
}
.track-order .t-id { font-weight: 800; font-size: 14px; }
.track-order .t-time { font-size: 11px; color: var(--gray); }
.track-order .t-items { font-size: 12px; color: var(--gray); margin: 4px 0 12px; }

.timeline { display: flex; align-items: flex-start; }
.t-step { flex: 1; text-align: center; position: relative; }
.t-step .t-dot {
  width: 34px; height: 34px; border-radius: 50%; margin: 0 auto;
  background: #eee; display: flex; align-items: center; justify-content: center;
  font-size: 15px; position: relative; z-index: 2; border: 3px solid #eee;
  transition: all .25s; filter: grayscale(1); opacity: .55;
}
.t-step .t-lbl { font-size: 10px; font-weight: 700; color: #999; margin-top: 6px; }
.t-step::before {
  content: ""; position: absolute; top: 17px; left: -50%; width: 100%;
  height: 4px; background: #eee; z-index: 1;
}
.t-step:first-child::before { display: none; }
.t-step.done .t-dot {
  background: var(--orange-light); border-color: var(--orange);
  filter: none; opacity: 1;
}
.t-step.done .t-lbl { color: var(--orange); }
.t-step.done::before { background: var(--orange); }
.t-step.current .t-dot {
  background: var(--orange); border-color: var(--orange);
  box-shadow: 0 0 0 5px rgba(16,52,166,.2); animation: glowPulse 1.5s infinite;
}
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 0 5px rgba(16,52,166,.2); }
  50% { box-shadow: 0 0 0 9px rgba(16,52,166,.08); }
}
.track-status-line {
  margin-top: 12px; text-align: center; font-size: 13px; font-weight: 700;
  color: var(--orange); background: var(--orange-light);
  padding: 8px; border-radius: 8px;
}

/* owner progress buttons */
.progress-ctrl { margin-top: 12px; }
.progress-ctrl .p-lbl { font-size: 11px; font-weight: 800; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.progress-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.p-btn {
  padding: 7px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: #f0f0f0; color: #777; border: 2px solid transparent; transition: all .15s;
}
.p-btn:hover { border-color: var(--orange); color: var(--orange); }
.p-btn.done { background: var(--orange-light); color: var(--orange); }
.p-btn.current { background: var(--orange); color: #fff; }

/* ============ DARK MODE ============ */
body.dark {
  --bg: #101014;
  --white: #1b1b22;
  --gray: #9a9aa5;
  --orange-light: #161e3a;
  --shadow: 0 2px 10px rgba(0,0,0,.5);
  background: var(--bg);
  color: #e8e8ee;
}
body.dark .cat-strip, body.dark .card, body.dark .panel, body.dark .stat,
body.dark .tabs, body.dark .empty, body.dark .modal, body.dark .drawer,
body.dark .login-card {
  background: #1b1b22; color: #e8e8ee;
}
body.dark .card-name, body.dark .panel-head h2, body.dark .stat .num,
body.dark .order-head .who, body.dark .modal h3, body.dark .login-card h1,
body.dark .prod-row .meta .n, body.dark .total-row,
body.dark .qty-controls span, body.dark .cart-row .info .n { color: #f0f0f5; }
body.dark .cat-item .nm { color: #ccccd6; }
body.dark .cat-item:hover, body.dark .cat-item.active { background: #161e3a; }
body.dark .card-img, body.dark .cart-row .thumb, body.dark .prod-row .thumb {
  background: linear-gradient(135deg,#181e30,#191f2e);
}
body.dark .tab { color: #9a9aa5; }
body.dark .tab:hover { background: #161e3a; color: var(--orange); }
body.dark .tab.active { background: var(--orange); color: #fff; }
body.dark .prod-row, body.dark .order-card { border-color: #2c2c36; }
body.dark .order-card.new { background: #141a30; }
body.dark .order-items, body.dark .order-items li { color: #c5c5cf; }
body.dark .field input, body.dark .field select, body.dark .field textarea,
body.dark .login-card input {
  background: #12121a; border-color: #33333f; color: #e8e8ee;
}
body.dark .icon-btn { background: #26262f; color: #ddd; }
body.dark .icon-btn:hover { background: #33333f; }
body.dark .icon-btn.danger { background: #3a1d1d; color: #ff7b7b; }
body.dark .btn-gray { background: #2c2c36; color: #ddd; }
body.dark .cart-row { border-bottom-color: #2c2c36; }
body.dark .drawer-foot { border-top-color: #2c2c36; }
body.dark .qty-controls button { background: #161e3a; }
body.dark .join-banner { background: linear-gradient(120deg,#000,#070f28); }
body.dark .login-card p { color: #9a9aa5; }
body.dark .empty { color: #9a9aa5; }
body.dark .receipt { background: #fff; color: #111; } /* receipt always white for printing */
body.dark .track-order { border-color: #2c2c36; }
body.dark .t-step .t-dot { background: #26262f; border-color: #26262f; }
body.dark .t-step::before { background: #26262f; }
body.dark .t-step.done .t-dot { background: #161e3a; border-color: var(--orange); }
body.dark .t-step.done::before { background: var(--orange); }
body.dark .t-step.current .t-dot { background: var(--orange); }
body.dark .p-btn { background: #26262f; color: #9a9aa5; }
body.dark .p-btn.done { background: #161e3a; color: var(--orange); }
body.dark .p-btn.current { background: var(--orange); color: #fff; }
body.dark .track-order .t-id { color: #f0f0f5; }

/* ============ DESKTOP POLISH ============ */
@media (min-width: 1000px) {
  .container { padding: 20px 24px; }
  .topbar-inner { padding: 14px 24px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stat { padding: 20px; }
  .stat .num { font-size: 30px; }
  .panel { padding: 24px; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
}

/* ============ MOBILE ============ */
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 12px; gap: 8px; }
  .logo { font-size: 19px; }
  .logo .bag { font-size: 20px; }
  .logo-img { height: 36px; border-radius: 8px; }
  .theme-btn { padding: 8px 11px; font-size: 15px; }
  .owner-link { padding: 7px 10px; font-size: 11px; }

  .container { padding: 12px; }

  /* stats: 2x2 grid */
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; }
  .stat .num { font-size: 21px; }
  .stat .lbl { font-size: 11px; }

  /* tabs: horizontal swipe */
  .tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 6px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; min-width: auto; padding: 10px 14px; font-size: 12px; white-space: nowrap; }

  .panel { padding: 14px; }
  .panel-head h2 { font-size: 15px; }
  .panel-head .btn { padding: 9px 14px; font-size: 13px; }

  /* product rows: wrap nicely */
  .prod-row { flex-wrap: wrap; padding: 10px; gap: 8px; }
  .prod-row .thumb { width: 46px; height: 46px; font-size: 22px; }
  .prod-row .meta { flex: 1 1 55%; }
  .prod-row .meta .n { font-size: 13px; }
  .prod-row .meta .sub { font-size: 11px; }
  .prod-row .price { font-size: 14px; }

  /* order cards */
  .order-card { padding: 12px; }
  .order-head .who { font-size: 14px; }
  .order-actions .btn { padding: 9px 12px; font-size: 12px; flex: 1 1 auto; text-align: center; }
  .progress-btns { gap: 5px; }
  .p-btn { padding: 6px 9px; font-size: 11px; }

  /* login card */
  .login-card { padding: 30px 22px; }

  /* modals */
  .modal { padding: 18px; border-radius: 12px; }
  .modal h3 { font-size: 17px; }

  /* team */
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .member-card { padding: 16px 10px; }
  .member-card .avatar { width: 50px; height: 50px; font-size: 21px; }
  .member-card .m-name { font-size: 14px; }
}

@media (max-width: 360px) {
  .stats { gap: 8px; }
  .tab { padding: 9px 11px; font-size: 11px; }
}

/* ---------- ADD PRODUCT WIZARD (steps 1-4) ---------- */
.wiz-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.wiz-step {
  flex: 1; text-align: center; font-size: 11px; font-weight: 800; color: #999;
  padding: 8px 4px; border-radius: 8px; background: #f1f1f1; position: relative;
}
.wiz-step.active { background: var(--orange); color: #fff; }
.wiz-step.done { background: var(--orange-light); color: var(--orange); }
.wiz-pane { display: none; }
.wiz-pane.show { display: block; animation: popIn .18s; }
.wiz-nav { display: flex; gap: 10px; margin-top: 18px; }
.wiz-nav .btn { flex: 1; }
.wiz-preview {
  border: 1px solid #eee; border-radius: 12px; padding: 14px; text-align: center;
}
.wiz-preview .wp-img {
  height: 120px; border-radius: 10px; background: linear-gradient(135deg,#dbe4fa,#eef2fc);
  display: flex; align-items: center; justify-content: center; font-size: 52px;
  overflow: hidden; margin-bottom: 10px;
}
.wiz-preview .wp-img img { height: 100%; object-fit: contain; }
.wiz-preview .wp-name { font-weight: 800; }
.wiz-preview .wp-price { color: var(--orange); font-weight: 800; font-size: 18px; }
.wiz-preview .wp-sub { font-size: 12px; color: var(--gray); margin-top: 4px; }
.img-pick { border: 2px dashed #ccc; border-radius: 12px; padding: 14px; text-align: center; }
.img-pick img { max-height: 110px; border-radius: 8px; margin-top: 8px; }
body.dark .wiz-step { background: #26262f; color: #9a9aa5; }
body.dark .wiz-step.active { background: var(--orange); color: #fff; }
body.dark .wiz-step.done { background: #1a2438; color: var(--orange); }
body.dark .wiz-preview, body.dark .img-pick { border-color: #2c2c36; }

/* ---------- QR SETTINGS ---------- */
.qr-box { border: 1px solid #eee; border-radius: 12px; padding: 16px; text-align: center; max-width: 320px; }
.qr-box img { width: 220px; max-width: 100%; border-radius: 10px; border: 1px solid #eee; }
.qr-box .no-qr { padding: 30px; color: var(--gray); background: #f7f7f7; border-radius: 10px; font-size: 13px; }
body.dark .qr-box { border-color: #2c2c36; }
body.dark .qr-box .no-qr { background: #26262f; }

/* ---------- PAYMENT STATUS ON ORDERS ---------- */
.pay-status { font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px; }
.pay-waiting { background: #eee; color: #777; }
.pay-review { background: #fff3d6; color: #b07b00; }
.pay-confirmed { background: #d9f2ee; color: #26aa99; }
.pay-cod { background: #e8f0fe; color: #1a56db; }
.proof-thumb {
  margin-top: 8px; display: inline-block; border: 2px solid #f5a623; border-radius: 10px;
  overflow: hidden; cursor: pointer;
}
.proof-thumb img { height: 90px; display: block; }
.proof-full { text-align: center; }
.proof-full img { max-width: 100%; max-height: 70vh; border-radius: 10px; }
body.dark .pay-waiting { background: #26262f; color: #9a9aa5; }


/* ---------- CENTERED LOGO ---------- */
.topbar-inner .logo { flex-basis: 100%; display: flex; justify-content: center; order: -1; margin-bottom: 4px; }
.topbar-inner { justify-content: center; }


/* ---------- TRANSPARENT TOPBAR LOGO ---------- */
.logo-img { border-radius: 0 !important; box-shadow: none !important; background: none !important; height: 56px; }
@media (max-width: 640px) { .logo-img { height: 42px; } }

/* ============ PRO ANIMATIONS ============ */
/* animated tick */
.tick-anim { width: 90px; height: 90px; display: block; margin: 0 auto; }
.tick-circle {
  fill: none; stroke: var(--green); stroke-width: 3;
  stroke-dasharray: 166; stroke-dashoffset: 166;
  animation: tickCircle .7s ease forwards;
}
.tick-check {
  fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48;
  animation: tickCheck .45s .65s ease forwards;
}
@keyframes tickCircle { to { stroke-dashoffset: 0; } }
@keyframes tickCheck { to { stroke-dashoffset: 0; } }

/* typing dots */
.typing-dots { display: inline-flex; gap: 4px; padding-top: 4px; }
.typing-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: #1a3c8b; opacity: .4;
  animation: typeDot 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes typeDot { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* page entrance animations */
.card, .prod-row, .order-card, .stat, .member-card { animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card:nth-child(2) { animation-delay: .04s; } .card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; } .card:nth-child(5) { animation-delay: .16s; }
.card:nth-child(6) { animation-delay: .2s; }

/* button press feedback */
.btn:active, .add-btn:active, .tab:active, .cart-btn:active { transform: scale(.96); }
.btn, .add-btn, .tab { transition: transform .12s, background .2s, box-shadow .2s; }

/* modal pop */
.modal { animation: popIn .25s cubic-bezier(.34,1.4,.64,1); }

/* topbar buttons hover lift */
.signin-btn:hover, .track-btn:hover, .theme-btn:hover { transform: translateY(-1px); }
.signin-btn, .track-btn, .theme-btn { transition: transform .15s, background .2s; }

/* ============ TV VIEW (1900px+) ============ */
@media (min-width: 1900px) {
  html { font-size: 20px; }
  .container { max-width: 1720px; padding: 32px 40px; }
  .topbar-inner { max-width: 1720px; padding: 20px 40px; gap: 22px; }
  .logo-img { height: 80px; }
  .owner-link, .theme-btn { font-size: 17px; padding: 14px 22px; border-radius: 12px; }

  .stats { gap: 22px; }
  .stat { padding: 28px; border-radius: 16px; border-left-width: 6px; }
  .stat .num { font-size: 44px; }
  .stat .lbl { font-size: 17px; }

  .tabs { padding: 12px; border-radius: 16px; gap: 10px; }
  .tab { padding: 17px 12px; font-size: 18px; border-radius: 12px; }
  .tab .badge { font-size: 14px; padding: 3px 10px; }

  .panel { padding: 32px; border-radius: 18px; }
  .panel-head h2 { font-size: 26px; }
  .btn { font-size: 18px; padding: 15px 26px; border-radius: 12px; }

  .prod-row { padding: 20px; border-radius: 14px; gap: 18px; }
  .prod-row .thumb { width: 84px; height: 84px; font-size: 42px; border-radius: 14px; }
  .prod-row .meta .n { font-size: 19px; }
  .prod-row .meta .sub { font-size: 15px; }
  .prod-row .price { font-size: 22px; }
  .icon-btn { padding: 13px 16px; font-size: 19px; }

  .order-card { padding: 24px; border-radius: 16px; }
  .order-head .who { font-size: 21px; }
  .order-time, .order-items { font-size: 16px; }
  .order-total { font-size: 22px; }
  .status-pill, .pay-status { font-size: 15px; padding: 7px 18px; }
  .p-btn { font-size: 15px; padding: 10px 16px; }

  .modal { width: 640px; padding: 36px; border-radius: 20px; }
  .modal h3 { font-size: 27px; }
  .field input, .field select, .field textarea { padding: 15px 18px; font-size: 18px; border-radius: 12px; }

  .team-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
  .member-card { padding: 30px 22px; border-radius: 18px; }
  .member-card .avatar { width: 92px; height: 92px; font-size: 38px; }
  .member-card .m-name { font-size: 22px; }

  .login-card { width: 560px; padding: 56px 48px; border-radius: 24px; }
  .login-card input { padding: 18px; font-size: 19px; }
  #toast { font-size: 19px; padding: 17px 32px; }
}

/* TV remote / keyboard focus */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 4px solid #ffdf00 !important;
  outline-offset: 3px;
  border-radius: 8px;
  z-index: 5;
}
