:root {
  --ivory: #FBF3E6;
  --ivory-deep: #F5E9D6;
  --ink: #2B211B;
  --ink-soft: #5A4C40;
  --maroon: #6E1E39;
  --maroon-deep: #521329;
  --gold: #C9A227;
  --gold-soft: #E4C868;
  --blush: #F3DFCB;
  --emerald: #1F4D3D;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  direction: ltr;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

body.urdu {
  direction: rtl;
}
body.urdu .brand-en,
body.urdu [data-en-only] {
  display: none;
}
body.urdu [data-i18n] {
  font-family: 'Noto Nastaliq Urdu', serif;
  line-height: 2;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.8rem; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-maroon { background: var(--maroon); color: var(--ivory); }
.btn-maroon:hover { background: var(--maroon-deep); }
.btn-gold { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: var(--maroon-deep); }
.btn-outline { background: transparent; border: 2px solid var(--maroon); color: var(--maroon); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.full-width { width: 100%; }
.icon-btn {
  background: var(--ivory-deep);
  border: none;
  border-radius: 999px;
  min-width: 42px; height: 42px;
  padding: 0 12px;              /* lets text buttons (اردو / account) grow instead of overlapping */
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.1rem;
  position: relative;
}
.icon-btn:hover { background: var(--blush); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251,243,230,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blush);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--maroon));
  color: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-weight: 700;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-en { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.15rem; color: var(--maroon-deep); }
.brand-ur { font-size: 0.75rem; color: var(--ink-soft); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.region-select {
  border: 1px solid var(--blush);
  background: var(--ivory-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.region-display {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--blush);
  background: var(--ivory-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  white-space: nowrap;
}
.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--maroon); color: var(--ivory);
  font-size: 0.65rem; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ---------- Header accent strip (fills the visual space the removed
   hero banner used to occupy, keeps the top of the page from feeling
   abrupt) ---------- */
.header-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 50%, var(--gold) 100%);
}

/* ---------- Categories ---------- */
.categories-row { padding-top: 22px; padding-bottom: 10px; }
.categories-row { position: relative; }
.chips {
  display: flex; flex-wrap: nowrap; gap: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 2px;
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}
.chips::-webkit-scrollbar { display: none; }
body.urdu .chips {
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
}
.chip {
  border: 1px solid var(--blush);
  background: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all .15s ease;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip:hover { border-color: var(--gold); }
.chip.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--ivory);
}

/* ---------- Product grid ---------- */
.loading-banner, .offline-banner, .empty-state {
  text-align: center;
  padding: 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 0.9rem;
}
.loading-banner { background: var(--ivory-deep); color: var(--ink-soft); }
.offline-banner { background: #FCEFD8; color: #7A5A12; border: 1px solid var(--gold-soft); }
.empty-state { background: var(--ivory-deep); color: var(--ink-soft); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding: 24px 0 64px;
}
.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(43,33,27,0.06);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(43,33,27,0.12);
}
.product-media {
  height: 200px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,0.9);
  color: var(--maroon-deep);
  font-size: 0.68rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.product-tag.discount { background: var(--maroon); color: var(--ivory); }
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.product-cat { font-size: 0.78rem; color: var(--ink-soft); }
.product-body .product-code { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin: 0; }
.product-price-row {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px;
}
.product-price { font-weight: 700; color: var(--maroon-deep); }
.add-btn {
  background: var(--ivory-deep);
  border: none; border-radius: 999px;
  width: 34px; height: 34px;
  font-size: 1.1rem; cursor: pointer;
  color: var(--maroon);
}
.add-btn:hover { background: var(--gold-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--maroon-deep);
  color: var(--ivory);
  padding: 16px 0 10px;
  margin-top: 12px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.site-footer .muted { color: rgba(251,243,230,0.7); }
.admin-link {
  background: transparent;
  border: 1px solid rgba(251,243,230,0.4);
  color: var(--ivory);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.admin-link:hover { background: rgba(251,243,230,0.1); }

/* ---------- Install popup ---------- */
.install-popup {
  position: fixed; bottom: 20px; right: 20px; z-index: 50;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  padding: 18px 20px; max-width: 260px;
}
body.urdu .install-popup { right: auto; left: 20px; }
.install-close {
  position: absolute; top: 6px; right: 10px;
  background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--ink-soft);
}
.install-popup p { margin: 6px 0 12px; font-size: 0.85rem; }

/* ---------- Modal / overlay ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43,33,27,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 32px;
  max-width: 420px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.lang-card { text-align: center; }
.lang-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* Product editor (Add/Edit Product) opens on top of the admin dashboard modal.
   Both share .modal-overlay (z-index:100), and since #adminOverlay comes after
   #quickViewOverlay in the DOM, it was painting over the product form and
   hiding it. Force the quick-view/product-editor overlay above any admin modal. */
#quickViewOverlay { z-index: 110; }

.quick-view-card { max-width: 520px; }
.qv-media {
  height: 240px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9); font-family: 'Playfair Display', serif; font-size: 1.6rem;
  margin-bottom: 18px;
}
.qv-media { position: relative; }
.qv-media img { width: 100%; height: 100%; object-fit: cover; }
.qv-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.qv-price { font-size: 1.3rem; font-weight: 700; color: var(--maroon-deep); margin: 10px 0 18px; }

.media-count-badge {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.7rem; padding: 3px 9px; border-radius: 999px;
}
body.urdu .media-count-badge { right: auto; left: 10px; }

.qv-thumbs {
  display: flex; gap: 8px; margin: 10px 0 16px;
}
.qv-thumb {
  width: 54px; height: 54px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--blush); background: var(--ivory-deep);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.qv-thumb:hover { border-color: var(--gold); }
.qv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qv-thumb-video { color: var(--maroon); font-size: 1.1rem; }

.qv-size-field { margin: 4px 0 16px; }
.qv-size-options {
  display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 6px; scrollbar-width: thin;
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
}
.qv-size-options::-webkit-scrollbar { height: 4px; }
.qv-size-options::-webkit-scrollbar-thumb { background: var(--blush); border-radius: 999px; }
body.urdu .qv-size-options {
  mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent 100%);
}
.size-chip {
  flex: 0 0 auto; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  color: var(--ink); transition: border-color .15s, background .15s, color .15s;
}
.size-chip:hover { border-color: var(--gold); }
.size-chip.active { border-color: var(--emerald); background: var(--emerald); color: #fff; box-shadow: 0 2px 8px rgba(31,77,61,0.35); }

.qv-qty-control { justify-content: flex-start; margin-bottom: 16px; }
.qv-qty-control button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 1rem;
}
.qv-qty-control span { min-width: 28px; text-align: center; font-weight: 600; }

.qv-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.qv-actions .btn,
.qv-actions .whatsapp-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; box-sizing: border-box; margin: 0; flex: 0 0 auto;
  position: relative; /* never absolute — guarantees normal document flow, no overlap */
}
.whatsapp-btn {
  text-decoration: none; border-color: #25D366; color: #128C4A;
}
.whatsapp-btn:hover { background: #25D36618; }

.free-delivery-tag {
  font-size: 0.7rem; font-weight: 500; color: var(--ink-soft);
  line-height: 1.35; margin-top: 2px;
}
.qv-price + .free-delivery-tag { margin-top: -12px; margin-bottom: 14px; }

/* ---------- Cart drawer ---------- */
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 101;
  width: min(400px, 100%);
  background: var(--ivory);
  display: flex; flex-direction: column;
  box-shadow: -6px 0 24px rgba(0,0,0,0.15);
}
body.urdu .drawer { right: auto; left: 0; box-shadow: 6px 0 24px rgba(0,0,0,0.15); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid var(--blush);
}
.cart-lines { flex: 1; overflow-y: auto; padding: 12px 22px; }
.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--blush); align-items: center; }
.cart-line-media {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.7rem;
}
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.cart-line-body { flex: 1; }
.cart-line-name { font-weight: 600; font-size: 0.9rem; }
.cart-line-price { font-size: 0.82rem; color: var(--ink-soft); }
.qty-control { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-control button {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.9rem;
}
.cart-empty { text-align: center; padding: 40px 0; color: var(--ink-soft); }
.drawer-footer { padding: 18px 22px 24px; border-top: 1px solid var(--blush); }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
.cart-grand-total { font-size: 1.05rem; font-weight: 700; margin: 10px 0 14px; padding-top: 10px; border-top: 1px dashed var(--blush); }

/* ---------- Payment method (frontend only, UI for now) ---------- */
.payment-options { display: flex; flex-direction: column; gap: 8px; }
.payment-option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--blush); border-radius: 10px;
  padding: 10px 12px; font-size: 0.88rem; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.payment-option:has(input:checked) { border-color: var(--gold); background: var(--ivory-deep); }
.payment-option input { accent-color: var(--maroon); }

/* ---------- Admin ---------- */
.admin-card h3 { font-family: 'Playfair Display', serif; color: var(--maroon-deep); margin-top: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--blush); font-family: inherit; font-size: 16px;
}
.field textarea { resize: vertical; min-height: 70px; }
.error-text { color: var(--maroon); font-size: 0.85rem; margin: 8px 0; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.role-tab {
  flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
}
.role-tab.active { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); }

/* ---- Production / Inventory pipeline tables ---- */
.pill-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.pill-nav button {
  border: 1px solid var(--maroon); background: transparent; color: var(--maroon);
  border-radius: 999px; padding: 6px 12px; font-size: 0.78rem; cursor: pointer;
}
.pill-nav button.active { background: var(--maroon); color: var(--ivory); }
.table-wrap { overflow-x: auto; margin: 10px 0 20px; }
table.data-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
table.data-table th, table.data-table td {
  border: 1px solid var(--blush); padding: 6px 8px; text-align: left; white-space: nowrap;
}
table.data-table th { background: var(--ivory-deep); font-weight: 600; }
table.data-table input, table.data-table select { width: 100%; min-width: 90px; font-size: 0.8rem; padding: 3px 4px; }
table.data-table td.actions-cell { white-space: nowrap; }
/* Assign-orders grid: every input/select fills its own cell and sits on its own line
   (cells are nowrap, so inline inputs used to land side by side and overlap the next column). */
table.grid-assign { width: max-content; min-width: 100%; }
table.grid-assign td { vertical-align: top; min-width: 110px; }
table.grid-assign td:first-child { min-width: 36px; }
table.grid-assign input, table.grid-assign select { display: block; width: 100%; min-width: 100px; margin: 0 0 4px; }
table.grid-assign input:last-child, table.grid-assign select:last-child { margin-bottom: 0; }
table.grid-assign input[type="file"] { min-width: 170px; }
table.grid-assign td.actions-cell { min-width: 120px; }
.add-row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 10px 0 6px; }
.add-row-form .field { min-width: 130px; margin: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-ok { background: #dff3e3; color: #1f7a37; }
.badge-wait { background: #fbe7cf; color: #a15a00; }
.badge-cancelled { background: #f3d9d9; color: var(--maroon-deep); }
.admin-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--blush);
}
.admin-list-item .meta { font-size: 0.8rem; color: var(--ink-soft); }
.link-btn { background: none; border: none; color: var(--maroon); cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.danger-link { color: #a23; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.product-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--blush);
}
.product-row .thumb {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.65rem;
}
.product-row .grow { flex: 1; }
.product-row .name { font-weight: 600; font-size: 0.88rem; }
.product-row .sub { font-size: 0.75rem; color: var(--ink-soft); }

.add-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#quickViewContent .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Super Admin: dashboard stats / order cards ---------- */
.stat-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--blush);
  font-size: 0.85rem;
}
.order-card {
  border: 1px solid var(--blush); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 0.85rem;
}
.order-card-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 4px; }
.order-card select {
  border-radius: 8px; border: 1px solid var(--blush); padding: 6px 8px; font-family: inherit;
}
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px; margin-bottom: 6px;
}
.stat-card {
  border: 1px solid var(--blush); border-radius: 10px; padding: 12px;
  background: #fff;
}
.stat-card-label { font-size: 0.72rem; color: var(--ink-soft); margin-bottom: 4px; }
.stat-card-value { font-size: 1.05rem; font-weight: 700; color: var(--maroon); }

/* =================================================================
   MOBILE RESPONSIVENESS
   ================================================================= */
@media (max-width: 640px) {
  /* NOTE: only top/bottom padding here — `padding: 10px 0` used to wipe the
     container's left/right padding, pushing the logo to the screen edge. */
  .header-row { height: auto; min-height: 0; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
  .brand { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; font-size: 0.9rem; }
  .brand-text { line-height: 1.1; }
  .brand-en { font-size: 1rem; }
  .brand-ur { font-size: 0.68rem; }
  /* Row 2: currency pill on one side, buttons on the other */
  .header-actions { width: 100%; gap: 6px; }
  .region-select { padding: 7px 10px; font-size: 0.78rem; max-width: 118px; }
  .region-display { margin-inline-end: auto; padding: 7px 10px; font-size: 0.78rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .icon-btn { min-width: 38px; height: 38px; padding: 0 10px; font-size: 1rem; }
  .account-label { display: none; }   /* icon only on phones — "My Account" is in the sub-nav */
  .cart-badge { top: -3px; right: -3px; }
  body.urdu .cart-badge { right: auto; left: -3px; }

  .categories-row { padding-top: 18px; padding-bottom: 4px; }
  .chips { gap: 8px; }
  .chip { padding: 7px 14px; font-size: 0.8rem; }
  .size-chip { padding: 6px 11px; font-size: 0.78rem; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 16px 0 44px; }
  .product-media { height: 150px; font-size: 1.05rem; }
  .product-body { padding: 10px 12px 12px; gap: 4px; }
  .product-name { font-size: 0.85rem; }
  .product-cat { font-size: 0.7rem; }
  .product-body .product-code { font-size: 0.7rem; }
  .product-price { font-size: 0.9rem; }
  .free-delivery-tag { font-size: 0.66rem; }
  .add-btn { width: 32px; height: 32px; flex-shrink: 0; }
  .product-name { overflow-wrap: anywhere; }

  .modal-card { padding: 18px; border-radius: 14px; max-height: 92vh; }
  .modal-overlay { padding: 10px; }
  .quick-view-card { max-width: 100%; }
  .qv-media { height: 180px; }

  .drawer { width: 100%; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .install-popup { left: 12px; right: 12px; max-width: none; bottom: 12px; }
  body.urdu .install-popup { left: 12px; right: 12px; }
}

@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .brand-en { font-size: 0.86rem; }
  .brand-ur { display: none; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
  .region-select { max-width: 100px; padding: 6px 8px; font-size: 0.72rem; }
  .region-display { max-width: 120px; padding: 6px 8px; font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; }
  .icon-btn { min-width: 34px; height: 34px; padding: 0 8px; font-size: 0.92rem; }
  .header-actions { gap: 4px; }
}

/* ---------- Tablets / small laptops ---------- */
@media (min-width: 641px) and (max-width: 1024px) {
  .container { padding: 0 24px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
}

/* Prevent any accidental horizontal scroll on small screens */
html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; }

/* ---------- Standalone product detail page (product.html) ---------- */
.product-page-breadcrumb { padding-top: 18px; }
.back-link {
  display: inline-block; text-decoration: none; color: var(--maroon-deep, #6E1E39);
  font-weight: 600; font-size: 0.9rem;
}
.back-link:hover { text-decoration: underline; }

.product-page-grid {
  display: grid; grid-template-columns: minmax(0, 480px) minmax(280px, 420px);
  gap: 40px; align-items: start;
  padding: 24px 0 60px;
}
.product-page-gallery .product-page-media {
  aspect-ratio: 1 / 1; height: auto; margin-bottom: 0;
  border-radius: 16px; box-shadow: 0 6px 22px rgba(43,33,27,0.12);
}
.product-page-info h1 {
  font-family: 'Playfair Display', serif; font-size: 1.6rem; margin: 0 0 6px;
  color: var(--ink, #2b211b);
}
.product-page-info .product-cat { margin-bottom: 4px; }
.product-page-info .qv-actions { max-width: 420px; }

@media (max-width: 700px) {
  .product-page-grid { grid-template-columns: 1fr; gap: 20px; padding: 16px 0 40px; }
  .product-page-gallery .product-page-media { aspect-ratio: 4 / 3; }
}

/* ---------- Image zoom overlay (product.html) ---------- */
.image-zoom-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 8, 6, 0.94);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.image-zoom-close {
  position: absolute; top: 16px; right: 16px; z-index: 210;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.image-zoom-close:hover { background: rgba(255,255,255,0.28); }
body.urdu .image-zoom-close { right: auto; left: 16px; }
.image-zoom-stage {
  width: 100%; height: 100%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.image-zoom-stage img {
  max-width: 92%; max-height: 88%;
  user-select: none; -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
  cursor: zoom-in;
  touch-action: none;
}
/* Product-page gallery main image: signal it's zoomable */
.product-page-media img { cursor: zoom-in; }

/* ---------- Standalone Admin page (admin.html) ---------- */
body.admin-page { min-height: 100vh; }
.admin-page-main { padding-top: 40px; padding-bottom: 60px; }

.admin-login-wrap {
  min-height: calc(100vh - 180px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px 0;
}
.admin-login-card {
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 36px rgba(43,33,27,0.10);
  padding: 34px 30px;
}
.admin-login-card h1 {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; margin: 0 0 24px;
  text-align: center; color: var(--maroon-deep);
}

.admin-dashboard-shell {
  max-width: 920px; margin: 0 auto;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 36px rgba(43,33,27,0.08);
  padding: 28px 30px 34px;
}
.admin-dashboard-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
  padding-bottom: 16px; border-bottom: 1px solid var(--blush);
}
.admin-dashboard-head h2 {
  font-family: 'Playfair Display', serif; font-size: 1.35rem; margin: 0;
  color: var(--ink);
}

@media (max-width: 640px) {
  .admin-login-card { padding: 26px 20px; border-radius: 14px; }
  .admin-dashboard-shell { padding: 20px 16px 26px; border-radius: 14px; }
}

/* =================================================================
   SITE SUB-NAVIGATION (Home / About / Contact / Privacy)
   Used on index.html, product.html, about.html, contact.html, privacy.html
   ================================================================= */
.site-subnav {
  background: var(--ivory);
  border-bottom: 1px solid var(--blush);
}
.site-subnav-inner {
  display: flex;
  gap: 26px;
  justify-content: center;
  padding: 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;
}
.site-subnav-inner::-webkit-scrollbar { display: none; }
.site-subnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.site-subnav a:hover,
.site-subnav a.active {
  color: var(--maroon-deep);
  border-bottom-color: var(--gold);
}

/* ---------- Footer quick links (About / Contact / Privacy) ---------- */
.footer-inner.footer-inner-expanded {
  align-items: flex-start;
}
.footer-col-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold-soft);
  margin: 0 0 8px;
  position: relative;
  padding-bottom: 6px;
}
.footer-col-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 34px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 999px;
}
.footer-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.footer-links a {
  color: rgba(251,243,230,0.82);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color .15s ease, padding-left .15s ease;
  position: relative;
}
.footer-links a:hover { color: var(--gold-soft); padding-left: 4px; }
.footer-contact-line {
  color: rgba(251,243,230,0.82);
  font-size: 0.82rem;
  margin: 0 0 4px;
  text-decoration: none;
  display: inline-block;
  transition: color .15s ease, padding-left .15s ease;
}
.footer-contact-line:hover { color: var(--gold-soft); padding-left: 4px; }
.footer-bottom-row {
  border-top: 1px solid rgba(251,243,230,0.15);
  margin-top: 12px;
  padding-top: 10px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}

/* =================================================================
   STATIC CONTENT PAGES (about.html, contact.html, privacy.html)
   ================================================================= */
.page-hero { padding-top: 30px; padding-bottom: 8px; }
.page-hero .back-link { margin-bottom: 6px; display: inline-block; }
.page-eyebrow {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.75rem; font-weight: 700; color: var(--gold);
  margin: 6px 0 6px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--maroon-deep);
  margin: 0 0 12px;
  line-height: 1.2;
}
.page-subtitle {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 680px;
  line-height: 1.7;
  margin: 0 0 6px;
}
.divider-gold {
  height: 3px; width: 64px;
  background: linear-gradient(90deg, var(--gold), var(--maroon));
  border-radius: 999px;
  margin: 4px 0 22px;
}

.page-section { padding: 18px 0; }
.page-section + .page-section { padding-top: 6px; }
.page-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--maroon-deep);
  margin: 0 0 14px;
}
.page-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--maroon-deep);
  margin: 0 0 8px;
}
.page-section p {
  line-height: 1.8;
  color: var(--ink);
  margin: 0 0 14px;
}
.page-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 2px 10px rgba(43,33,27,0.06);
}

/* About page */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 4px 0 10px;
}
.about-feature {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 10px rgba(43,33,27,0.06);
}
.about-feature .about-feature-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--maroon-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: 12px;
}
.about-feature h3 { margin: 0 0 8px; font-size: 1.02rem; }
.about-feature p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.65; }
.about-quote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 18px;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--maroon-deep);
  font-style: italic;
  margin: 26px 0;
}

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 26px;
  align-items: start;
}
.contact-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--blush);
}
.contact-row:last-child { border-bottom: none; }
.contact-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ivory-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.contact-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-soft); margin: 0 0 3px;
}
.contact-value { font-weight: 600; color: var(--ink); word-break: break-word; }
.contact-value a { color: var(--maroon-deep); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }
.contact-value.placeholder { color: var(--ink-soft); font-style: italic; font-weight: 500; }
.contact-cta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }
.contact-cta .whatsapp-btn,
.contact-cta .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }

.support-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.support-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.93rem; color: var(--ink); line-height: 1.6;
}
.support-list li::before {
  content: "✓";
  color: var(--emerald); font-weight: 700; flex-shrink: 0;
}

/* Privacy policy page */
.policy-toc {
  background: #fff; border-radius: var(--radius);
  padding: 18px 24px; box-shadow: 0 2px 10px rgba(43,33,27,0.06);
  margin-bottom: 28px;
}
.policy-toc-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 0 0 10px; }
.policy-toc ol { margin: 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.policy-toc li { margin-bottom: 8px; }
.policy-toc a { color: var(--maroon-deep); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.policy-toc a:hover { text-decoration: underline; }
.policy-section { padding: 20px 0; border-bottom: 1px solid var(--blush); scroll-margin-top: 90px; }
.policy-section:last-of-type { border-bottom: none; }
.policy-section ul { margin: 0 0 14px; padding-left: 20px; }
.policy-section li { line-height: 1.75; margin-bottom: 6px; }
.updated-note { font-size: 0.85rem; color: var(--ink-soft); margin: -4px 0 0; }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .policy-toc ol { columns: 1; }
}
@media (max-width: 640px) {
  .page-card { padding: 20px; }
  .site-subnav-inner { justify-content: flex-start; gap: 18px; padding: 9px 20px; }
}

/* ---------- Product Code badge (cards, quick view, product page, cart) ---------- */
.product-code {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 2px 0 4px;
}
.cart-line-code { margin-top: 2px; }

/* ---------- Account header button ---------- */
.account-btn { font-size: 0.85rem; }
.account-label { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Account page (signup / login) ---------- */
.account-card { max-width: 460px; margin: 0 auto; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--blush);
  background: #fff; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft);
}
.auth-tab.active { background: var(--maroon); border-color: var(--maroon); color: var(--ivory); }
.account-value {
  padding: 10px 12px; border-radius: 10px; background: var(--ivory-deep);
  font-size: 0.95rem; color: var(--ink);
}
.account-success {
  background: var(--ivory-deep); border: 1px solid var(--gold-soft); color: var(--emerald);
  padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; margin-bottom: 14px;
}
.account-switch-line { text-align: center; margin-top: 14px; }
.account-switch-line a { color: var(--maroon); font-weight: 600; text-decoration: none; }
.account-switch-line a:hover { text-decoration: underline; }

/* Compact footer: tighter text, no extra <br>, small brand mark */
.site-footer .footer-brand .brand-mark { width: 34px; height: 34px; font-size: 0.8rem; }
.site-footer .footer-credit { margin: 2px 0 0; line-height: 1.35; font-size: 0.78rem; }
.site-footer .footer-inner br { display: none; }
.site-footer .footer-contact-line { display: block; }
.site-footer .admin-link { padding: 4px 12px; font-size: 0.78rem; }
@media (max-width: 640px) {
  .site-footer { padding: 12px 0 8px; }
  .footer-inner.footer-inner-expanded { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: start; }
  .footer-inner.footer-inner-expanded .footer-brand { grid-column: 1 / -1; }
  .footer-links { gap: 4px; }
}


/* =================================================================
   KARIGAR TASKS PAGE — card layout, no horizontal scrolling
   ================================================================= */
body[data-portal="karigar-tasks"] .admin-page-main { padding-top: 22px; }
body[data-portal="karigar-tasks"] .admin-dashboard-shell { max-width: 1180px; background: transparent; box-shadow: none; padding: 0; }
body[data-portal="karigar-tasks"] .admin-dashboard-head {
  background: #fff; border-radius: 14px; padding: 14px 18px; margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(43,33,27,0.07); border-bottom: 0;
}
body[data-portal="karigar-tasks"] #karigarTasksBody {
  background: #fff; border-radius: 14px; padding: 20px 22px 26px; box-shadow: 0 6px 20px rgba(43,33,27,0.07);
  overflow-x: hidden;
}
#karigarTasksBody h4 { font-family: 'Playfair Display', serif; color: var(--maroon-deep); font-size: 1.1rem; margin: 4px 0 8px; }
#karigarTasksBody * { min-width: 0; }
#karigarTasksBody .btn { padding: 9px 16px; border-radius: 10px; }

.kform-list { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.kform-card { border: 1px solid var(--blush); border-radius: 14px; padding: 14px 16px; background: #fffdf9; }
.kform-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kform-num { background: var(--maroon); color: var(--ivory); border-radius: 999px; padding: 3px 12px; font-size: 0.8rem; font-weight: 700; }
.kform-actions { margin-left: auto; display: flex; gap: 12px; }
.kform-sub { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--gold); margin: 14px 0 6px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; }
.kf label { display: block; font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.kf input, .kf select { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--blush); font-family: inherit; font-size: 0.88rem; background: #fff; }
.kf-wide { grid-column: span 2; }
.kform-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--blush); }
.kf-inline { display: flex; align-items: center; gap: 8px; } .kf-inline label { margin: 0; } .kf-inline select { width: auto; }

.ko-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin: 12px 0 8px; }
.ko-card { border: 1px solid var(--blush); border-radius: 14px; padding: 14px 16px; background: #fffdf9; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 8px rgba(43,33,27,0.04); }
.ko-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ko-no { font-weight: 700; font-size: 1rem; color: var(--maroon-deep); }
.ko-product { font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.ko-dates { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.76rem; }
.ko-k { display: block; color: var(--ink-soft); font-size: 0.7rem; } .ko-v { font-weight: 600; }
.ko-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--blush); }
.ko-labor { font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.ko-labor input, .ko-labor select { width: 96px; padding: 5px 7px; border-radius: 8px; border: 1px solid var(--blush); font-size: 0.82rem; }
.ko-labor select { width: auto; }
.ko-panel { background: #fbf7ef; border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
.ko-panel .add-row-form .field { min-width: 0; flex: 1 1 130px; }
.ko-panel .add-row-form input { width: 100%; box-sizing: border-box; }
#karigarTasksBody .table-wrap { overflow-x: visible; }
#karigarTasksBody table.data-table th, #karigarTasksBody table.data-table td { white-space: normal; }

@media (max-width: 640px) {
  body[data-portal="karigar-tasks"] #karigarTasksBody { padding: 14px 12px 20px; }
  .kgrid { grid-template-columns: 1fr 1fr; }
  .kf-wide { grid-column: 1 / -1; }
  .ko-list { grid-template-columns: 1fr; }
}
@media (max-width: 380px) { .kgrid { grid-template-columns: 1fr; } }

.money-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #fbf7ef; border: 1px solid var(--blush); border-radius: 10px; padding: 8px 10px; margin: 8px 0 4px; }
.money-box .small { font-size: 0.7rem; }
.money-box > div > div:last-child { font-size: 0.86rem; overflow-wrap: anywhere; }
#karigarTasksBody table.data-table th, #karigarTasksBody table.data-table td { padding: 5px 6px; font-size: 0.76rem; }


/* =================================================================
   SUPER ADMIN / MANAGER DASHBOARDS — cleaner layout, no sideways scrolling
   ================================================================= */
.admin-dashboard-shell { max-width: 1180px; }
.role-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.role-tab { text-decoration: none; text-align: center; font-family: inherit; transition: background .15s, border-color .15s; }
.role-tab:hover:not(.active) { border-color: var(--maroon); color: var(--maroon); }
.admin-dashboard-shell h4 { font-family: 'Playfair Display', serif; color: var(--maroon-deep); font-size: 1.05rem; margin: 18px 0 10px; }
.panel { border: 1px solid var(--blush); border-radius: 14px; padding: 14px 16px; background: #fffdf9; margin-bottom: 14px; }
.panel h4 { margin: 0 0 8px; }
.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.scroll-y { max-height: 320px; overflow-y: auto; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.card-grid > .admin-list-item {
  border: 1px solid var(--blush); border-radius: 12px; padding: 12px 14px; background: #fffdf9;
  align-items: flex-start; gap: 10px; box-shadow: 0 2px 8px rgba(43,33,27,0.04);
}
.card-grid > .admin-list-item > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.card-grid > .admin-list-item .link-btn { white-space: nowrap; }

.oc { border: 1px solid var(--blush); border-radius: 14px; padding: 14px 16px; background: #fffdf9; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 8px rgba(43,33,27,0.04); font-size: 0.85rem; }
.oc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.oc-no { font-weight: 700; font-size: 1rem; color: var(--maroon-deep); }
.oc-total { font-weight: 700; color: var(--maroon); white-space: nowrap; }
.oc-cust { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px dashed var(--blush); border-bottom: 1px dashed var(--blush); }
.oc-items { overflow-wrap: anywhere; }
.oc-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 0.8rem; } .oc-kv span { color: var(--ink-soft); } .oc-kv strong { text-align: right; font-weight: 600; }
.oc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

table.data-table th, table.data-table td { white-space: normal; vertical-align: top; }
table.data-table td.actions-cell { white-space: normal; }
.table-wrap { border-radius: 10px; }

@media (max-width: 900px) {
  .table-wrap { overflow-x: visible; }
  table.data-table[data-stacked], table.data-table[data-stacked] tbody { display: block; width: 100%; }
  table.data-table[data-stacked] thead { display: none; }
  table.data-table[data-stacked] tr { display: block; border: 1px solid var(--blush); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: #fffdf9; }
  table.data-table[data-stacked] td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right;
    border: 0; border-bottom: 1px dashed var(--blush); padding: 7px 0;
  }
  table.data-table[data-stacked] td:last-child { border-bottom: 0; }
  table.data-table[data-stacked] td::before { content: attr(data-label); font-weight: 600; color: var(--ink-soft); text-align: left; flex: 0 0 38%; font-size: 0.78rem; }
  table.data-table[data-stacked] td[data-label=""]::before { display: none; }
  table.data-table[data-stacked] td[data-label=""] { justify-content: flex-start; text-align: left; }
  table.data-table[data-stacked] td input, table.data-table[data-stacked] td select { width: 62%; min-width: 0; }
}
@media (max-width: 640px) {
  .role-tabs { grid-template-columns: 1fr 1fr; }
  .card-grid, .split-2 { grid-template-columns: 1fr; }
  .panel { padding: 12px; }
}

/* ---- Equal-size pill buttons (Marketer categories, Super Admin Sales) ---- */
.pill-nav.pill-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px;
}
.pill-nav.pill-grid button {
  width: 100%; min-height: 44px; padding: 8px 12px; font-size: 0.82rem; font-weight: 600;
  line-height: 1.2; text-align: center; border-radius: 12px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.pill-nav.pill-grid.pill-grid-sub { margin-top: -6px; }
.pill-nav.pill-grid.pill-grid-sub button { min-height: 38px; font-size: 0.78rem; border-style: dashed; }
.pill-nav.pill-grid.pill-grid-sub button.active { border-style: solid; }
@media (max-width: 520px) {
  .pill-nav.pill-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Super Admin Sales: same simple tabs as the top row, all equal size ---- */
.role-tabs.sales-tabs { grid-template-columns: repeat(3, 1fr); }
.sales-tabs .role-tab { min-height: 44px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 640px) { .role-tabs.sales-tabs { grid-template-columns: 1fr 1fr; } }

/* ---- Super Admin language switch (EN / اردو) ---- */
.admin-lang-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px; margin-inline-end: 8px;
  border: 1.5px solid var(--gold); border-radius: 999px; background: #fff; cursor: pointer; font-family: inherit;
  box-shadow: 0 1px 4px rgba(82,19,41,.12); transition: box-shadow .15s ease;
}
.admin-lang-btn:hover { box-shadow: 0 4px 12px rgba(82,19,41,.22); }
.alb-globe { padding: 0 4px 0 6px; font-size: .95rem; }
.alb-opt { padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); font-family: 'Noto Nastaliq Urdu','Inter',serif; line-height: 1.6; }
.alb-opt.on { background: linear-gradient(135deg, var(--maroon), var(--maroon-deep)); color: var(--ivory); }
body.admin-urdu .admin-dashboard-shell,
body.admin-urdu .admin-login-wrap,
body.admin-urdu .site-header .back-link { font-family: 'Noto Nastaliq Urdu', 'Inter', serif; }
body.admin-urdu .admin-dashboard-shell :is(h2,h4,label,button,.meta,.small,.stat-card-label,p,.role-tab) { line-height: 1.9; }
body.admin-urdu .admin-dashboard-shell input,
body.admin-urdu .admin-dashboard-shell table { direction: ltr; }
body.admin-urdu .admin-dashboard-shell .brand-en { display: inline; }


/* =================================================================
   INVENTORY TABS (Casting / Brass Wire / Golden Sets / Raw Data Bangles)
   - every button the same size (btn-maroon and btn-outline now have the same border)
   - clean on Android, iPhone and laptop
   ================================================================= */
#dashboardTabBody .btn-sm, #invModal .btn-sm {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 92px; min-height: 38px; padding: 6px 14px;
  border: 2px solid var(--maroon);
  font-size: 0.82rem; line-height: 1.2; white-space: nowrap;
  font-family: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#dashboardTabBody .btn-sm:disabled, #invModal .btn-sm:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* action buttons in a row sit in a tidy equal-size group */
#dashboardTabBody td.actions-cell .btn-sm, #invModal td.actions-cell .btn-sm { margin: 2px 4px 2px 0; }
#dashboardTabBody td.actions-cell, #invModal td.actions-cell { min-width: 210px; }

/* search / filter bar */
#dashboardTabBody .add-row-form, #invModal .add-row-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end;
  background: #fffdf9; border: 1px solid var(--blush); border-radius: 14px; padding: 12px;
}
#dashboardTabBody .add-row-form .field, #invModal .add-row-form .field { min-width: 0; margin: 0; }
#dashboardTabBody .add-row-form .field input, #dashboardTabBody .add-row-form .field select,
#invModal .add-row-form .field input, #invModal .add-row-form .field select { min-height: 40px; box-sizing: border-box; }
#dashboardTabBody .add-row-form > .btn-sm, #invModal .add-row-form > .btn-sm { width: 100%; }

/* summary cards + Summary by Type */
.inv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.inv-stats .stat-card { text-align: center; }
table.inv-summary th, table.inv-summary td { white-space: nowrap; }
table.inv-summary tr.inv-type-row { cursor: pointer; transition: background .12s; }
table.inv-summary tr.inv-type-row:hover { background: #f7ecec; }
table.inv-summary tr.inv-type-row.active { background: #f3dede; font-weight: 700; }

/* inputs inside inventory modals: 16px so iPhone Safari does not zoom in */
#invModal input, #invModal select { font-size: 16px; }
#invModal .modal-card { max-height: 90vh; max-height: 90dvh; -webkit-overflow-scrolling: touch; }

/* never let the page itself scroll sideways on a phone */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.admin-dashboard-shell, #dashboardTabBody { max-width: 100%; min-width: 0; }
img, video, canvas { max-width: 100%; }

/* ---- phones & small tablets ---- */
@media (max-width: 900px) {
  /* empty cells (total rows) would show as blank lines in the stacked card view */
  table.data-table[data-stacked] td:empty { display: none; }
  table.data-table[data-stacked] tr.inv-type-row, table.data-table.inv-summary[data-stacked] tr { padding: 6px 12px; }
  /* the Actions cell: label on top, buttons in a 2-column grid (all same size) */
  table.data-table[data-stacked] td.actions-cell {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; align-items: stretch; min-width: 0; padding: 10px 0 6px;
  }
  table.data-table[data-stacked] td.actions-cell::before { grid-column: 1 / -1; flex: none; }
  table.data-table[data-stacked] td.actions-cell > div { grid-column: 1 / -1; }
  #dashboardTabBody td.actions-cell .btn-sm, #invModal td.actions-cell .btn-sm { width: 100%; margin: 0; min-height: 42px; }
  table.data-table[data-stacked] td > div { text-align: right; }
  table.data-table[data-stacked] td.actions-cell > div { text-align: left; }
}
@media (max-width: 640px) {
  #dashboardTabBody .add-row-form, #invModal .add-row-form { grid-template-columns: 1fr 1fr; padding: 10px; }
  #dashboardTabBody .add-row-form .field:first-child { grid-column: 1 / -1; }   /* the Item Code search bar gets the full width */
  #dashboardTabBody .add-row-form > .btn-sm, #invModal .add-row-form > .btn-sm { grid-column: 1 / -1; min-height: 44px; }
  .inv-stats { grid-template-columns: repeat(2, 1fr); }
  #invModal.modal-overlay { padding: 8px; align-items: flex-end; }
  #invModal .modal-card { padding: 16px !important; border-radius: 16px; max-width: 100% !important; max-height: 94vh; max-height: 94dvh; padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important; }
  #invModal .modal-card > div[style*="justify-content:flex-end"] { display: grid !important; grid-template-columns: 1fr 1fr; }
  .role-tab { min-height: 44px; display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 380px) {
  #dashboardTabBody .add-row-form, #invModal .add-row-form { grid-template-columns: 1fr; }
  #dashboardTabBody td.actions-cell .btn-sm { min-width: 0; }
}
/* big screens: keep tables comfortable to read */
@media (min-width: 901px) {
  #dashboardTabBody .table-wrap { overflow-x: auto; }
  #dashboardTabBody table.data-table th, #dashboardTabBody table.data-table td { padding: 8px 10px; }
}

/* ===== Inventory Manager tabs: tidy toolbar (search / category / month / day) + action buttons ===== */
#dashboardTabBody .add-row-form.inv-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 0 0 8px;
}
#dashboardTabBody .add-row-form.inv-toolbar .field { flex: 0 1 170px; min-width: 130px; }
#dashboardTabBody .add-row-form.inv-toolbar .field.inv-grow { flex: 1 1 240px; max-width: 380px; }
#dashboardTabBody .add-row-form.inv-toolbar .field.inv-date { flex: 0 0 165px; }
#dashboardTabBody .add-row-form.inv-toolbar .field.inv-month { flex: 0 0 auto; min-width: 0; }
#dashboardTabBody .add-row-form.inv-toolbar .field label { margin-bottom: 4px; white-space: nowrap; }
#dashboardTabBody .add-row-form.inv-toolbar .field input,
#dashboardTabBody .add-row-form.inv-toolbar .field select { height: 40px; min-height: 40px; padding: 0 10px; font-size: 15px; box-sizing: border-box; }
.inv-month-box { display: flex; gap: 4px; align-items: center; }
.inv-month-box input[type="month"] { width: 160px; flex: 0 0 160px; }
.inv-month-box .btn-sm { height: 40px; min-height: 40px; width: 36px; padding: 0; line-height: 1; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
#dashboardTabBody .inv-actions .btn-sm { width: auto; min-height: 40px; padding: 0 16px; }
@media (max-width: 600px) {
  #dashboardTabBody .add-row-form.inv-toolbar .field,
  #dashboardTabBody .add-row-form.inv-toolbar .field.inv-grow,
  #dashboardTabBody .add-row-form.inv-toolbar .field.inv-date { flex: 1 1 calc(50% - 8px); max-width: none; min-width: 0; }
  #dashboardTabBody .add-row-form.inv-toolbar .field.inv-grow,
  #dashboardTabBody .add-row-form.inv-toolbar .field.inv-month { flex: 1 1 100%; }
  .inv-month-box input[type="month"] { flex: 1 1 auto; width: auto; min-width: 0; }
  #dashboardTabBody .inv-actions .btn-sm { flex: 1 1 calc(50% - 8px); }
}
/* forms inside the inventory pop-ups: equal-size boxes, 2 per row on small screens */
#invModal .add-row-form .field input, #invModal .add-row-form .field select { height: 42px; padding: 0 10px; box-sizing: border-box; width: 100%; min-width: 0; }
#invModal .add-row-form { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 480px) { #invModal .add-row-form { grid-template-columns: 1fr 1fr; } }

/* ===== Inventory tables: compact one-line rows (desktop / tablet) ===== */
@media (min-width: 901px) {
  .table-wrap.inv-wrap { overflow-x: auto; }
  table.data-table.inv-table { font-size: 0.8rem; }
  table.data-table.inv-table th, table.data-table.inv-table td { white-space: nowrap; vertical-align: middle; padding: 4px 8px; line-height: 1.25; }
  table.data-table.inv-table td.actions-cell { white-space: nowrap; }
  #dashboardTabBody table.inv-table td.actions-cell .btn-sm {
    display: inline-block; width: auto; min-height: 0; height: 28px; padding: 0 10px; margin: 0 3px 0 0;
    font-size: 0.74rem; line-height: 26px; border-radius: 8px;
  }
  table.inv-table td .small { font-size: 0.7rem; }
}

/* ===== Inventory tables: tidy layout (scroll box, fixed header + first column, aligned numbers) ===== */
@media (min-width: 901px) {
  .table-wrap.inv-wrap { max-height: 68vh; overflow: auto; border: 1px solid var(--blush); border-radius: 10px; background: #fff; }
  table.data-table.inv-table { border-collapse: separate; border-spacing: 0; width: 100%; }
  table.data-table.inv-table th, table.data-table.inv-table td { border: 0; border-right: 1px solid #f1e3d6; border-bottom: 1px solid #f1e3d6; }
  table.data-table.inv-table thead th { position: sticky; top: 0; z-index: 3; background: var(--ivory-deep); border-bottom: 2px solid var(--blush); font-weight: 700; }
  table.data-table.inv-table tbody tr:nth-child(even) td { background: #fffaf4; }
  table.data-table.inv-table tbody tr:hover td { background: #f8ece3; }
  table.data-table.inv-table th:first-child, table.data-table.inv-table td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; font-weight: 600; box-shadow: 1px 0 0 #f1e3d6; }
  table.data-table.inv-table thead th:first-child { z-index: 4; background: var(--ivory-deep); }
  table.data-table.inv-table tbody tr:nth-child(even) td:first-child { background: #fffaf4; }
  table.data-table.inv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
  table.data-table.inv-table tr.inv-total td { background: #f6ebdf !important; border-top: 2px solid var(--blush); position: sticky; bottom: 0; z-index: 2; }
  table.data-table.inv-table td.actions-cell { text-align: right; min-width: 250px; }
  table.data-table.inv-table th:last-child { text-align: right; }
}
@media (min-width: 901px) {
  table.data-table.inv-table tbody tr[style*="background"] td { background: #ececec !important; }
}

/* ===== Raw Data Bangles table: narrower columns so it fits the screen ===== */
@media (min-width: 901px) {
  table.data-table.inv-raw { font-size: 0.76rem; }
  table.data-table.inv-raw th, table.data-table.inv-raw td { padding: 3px 6px; }
  table.data-table.inv-raw td.actions-cell { min-width: 0; }
  #dashboardTabBody table.inv-raw td.actions-cell .btn-sm { padding: 0 7px; height: 26px; line-height: 24px; font-size: 0.72rem; margin-right: 2px; }
  table.data-table.inv-raw .inv-mcol { background: #fbf3ea; }
  table.data-table.inv-raw thead th.inv-mcol { background: #f3e2cf; }
  table.data-table.inv-raw td:nth-child(6) { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
}

/* In / Out dropdown inside the Entries list */
.inv-dir-select { height: 30px; border-radius: 8px; border: 1px solid var(--blush); padding: 0 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.inv-dir-select.is-in { background: #e7f4ea; color: #1e6b34; }
.inv-dir-select.is-out { background: #fdf0dc; color: #8a5a00; }

tr.inv-click { cursor: pointer; }
tr.inv-click:hover td { background: #f8ece3 !important; }
tr.inv-row-editing td { background: #fff3c4 !important; }
