@font-face {
  font-family: 'BPG';
  src: url('../fonts/bpg_ingiri_arial.ttf') format('truetype');
  font-weight: normal;
}
@font-face {
  font-family: 'BPG';
  src: url('../fonts/bpg_ingiri_arial.ttf') format('truetype');
  font-weight: bold;
}

:root {
  --c-bg:        #f0f2f5;
  --c-surface:   #ffffff;
  --c-border:    #e2e6ed;
  --c-primary:   #2563eb;
  --c-primary-h: #1d4ed8;
  --c-primary-l: #eff6ff;
  --c-danger:    #dc2626;
  --c-danger-l:  #fef2f2;
  --c-success:   #16a34a;
  --c-warning:   #d97706;
  --c-text:      #1a2332;
  --c-muted:     #64748b;
  --c-nav-bg:    #16213e;
  --c-nav-text:  #94a3b8;
  --c-nav-act:   #ffffff;
  --c-nav-hover: rgba(255,255,255,.07);
  --c-nav-line:  rgba(255,255,255,.06);

  --r:      8px;
  --r-lg:   12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --font:   'BPG', sans-serif;
  --fs:     14px;
  --nav-w:  240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: var(--fs);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────── */
.nav {
  width: var(--nav-w);
  background: var(--c-nav-bg);
  color: var(--c-nav-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.nav-logo {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--c-nav-line);
}
.nav-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.nav-logo-icon {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.nav-logo-text {
  font-weight: bold;
  font-size: 17px;
  color: var(--c-nav-act);
  letter-spacing: .3px;
}
.nav-logo-dot {
  width: 8px; height: 8px;
  background: var(--c-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--c-nav-act);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.nav-section {
  padding: 16px 12px 4px;
  font-size: 10px;

  letter-spacing: 1px;
  color: rgba(255,255,255,.25);
}

.nav-links {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 8px 0 16px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: var(--r);
  color: var(--c-nav-text);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--c-nav-hover); color: #e2e8f0; text-decoration: none; }
.nav a.active { background: var(--c-primary); color: #fff; }
.nav a.active:hover { background: var(--c-primary-h); }

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-logout {
  margin-top: auto !important;
  border-top: 1px solid var(--c-nav-line);
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 12px 18px !important;
  color: rgba(255,255,255,.4) !important;
}
.nav-logout:hover { color: var(--c-danger) !important; background: rgba(220,38,38,.08) !important; }

/* ── Main ─────────────────────────────── */
.main {
  margin-left: var(--nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 17px; font-weight: bold; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-muted);
  font-size: 13px;
}
.topbar-avatar {
  width: 30px; height: 30px;
  background: var(--c-primary-l);
  color: var(--c-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 13px;
}

.content { padding: 24px 28px; flex: 1; }

/* ── Card ─────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: bold;
  font-size: 15px;
}
.card-body { padding: 20px; }

/* ── Table ─────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.tbl-wrap::-webkit-scrollbar { height: 5px; }
.tbl-wrap::-webkit-scrollbar-track { background: var(--c-bg); }
.tbl-wrap::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 99px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 480px; }
.tbl th {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 2px solid var(--c-border);
  color: var(--c-muted);
  font-weight: normal;
  font-size: 11px;

  letter-spacing: .5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--c-surface);
}
.tbl td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl td:last-child { width: 40px; text-align: right; }
.txt-l          { text-align: left; }
.txt-r          { text-align: right; }
.txt-c          { text-align: center; }
.tbl th.txt-l   { text-align: left; }
.tbl th.txt-c   { text-align: center; }
.cell-id { color: var(--c-muted); width: 40px; text-align: right; }
.cell-name { font-weight: bold; }
.cell-note { color: var(--c-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--c-muted); font-size: 14px; }
.phones-cell { display: flex; flex-direction: column; gap: 4px; }
.phone-link { color: var(--c-muted); font-size: 13px; white-space: nowrap; }
.phone-link:hover { color: var(--c-primary); }
.pin-link { font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.pin-link:hover { color: var(--c-primary); }
.pin-nolink { font-size: 13px; color: var(--c-muted); white-space: nowrap; }
.customer-name { font-weight: bold; color: var(--c-text); }
.customer-name:hover { color: var(--c-primary); text-decoration: none; }

/* ── Forms ─────────────────────────────── */
.form-row { margin-bottom: 16px; }
.form-row-sm { margin-bottom: 8px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.form-row label {
  display: block;
  margin-bottom: 5px;
  color: var(--c-muted);
  font-size: 12px;
  font-weight: bold;

  letter-spacing: .4px;
}
.inp {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
select.inp { cursor: pointer; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--fs);
  font-weight: bold;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 1px 4px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--c-primary-h); box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.btn-danger  { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost   { background: transparent; color: var(--c-muted); border: 1px solid var(--c-border); }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.unit-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: normal;
  background: var(--c-primary-l);
  color: var(--c-primary);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Badge ─────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: bold;
  gap: 4px;
}
.badge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.badge-pending   { background: #fef9c3; color: #854d0e; }
.badge-pending::before   { background: #ca8a04; }
.badge-ready     { background: #dcfce7; color: #166534; }
.badge-ready::before     { background: #16a34a; }
.badge-delivery  { background: #dbeafe; color: #1e40af; }
.badge-delivery::before  { background: #3b82f6; }
.badge-delivered { background: #f3e8ff; color: #6b21a8; }
.badge-delivered::before { background: #a855f7; }

/* ── Alert ─────────────────────────────── */
.alert { padding: 11px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: 13px; border-left: 3px solid; }
.alert-err { background: var(--c-danger-l); color: var(--c-danger); border-color: var(--c-danger); }
.alert-ok  { background: #f0fdf4; color: var(--c-success); border-color: var(--c-success); }

/* ── Modal ─────────────────────────────── */
.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 15px;
}
.modal-body { padding: 20px; }
.modal-close {
  cursor: pointer;
  color: var(--c-muted);
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.modal-close:hover { background: var(--c-bg); }

/* ── Toast ─────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--c-text);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--r);
  font-size: 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s;
  z-index: 999;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
#toast.show { opacity: 1; transform: translateY(0); }

/* ── Dropdown ─────────────────────────────── */
.ddrop { position: relative; display: inline-block; }
.ddrop-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--c-muted);
  padding: 3px 8px;
  border-radius: var(--r);
  line-height: 1;
  letter-spacing: 1px;
}
.ddrop-btn:hover { background: var(--c-bg); color: var(--c-text); }
.ddrop-menu {
  display: none;
  position: fixed;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 500;
  overflow: hidden;
}
.ddrop-menu.open { display: block; }
.ddrop-menu a, .ddrop-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  color: var(--c-text);
  text-decoration: none;
  transition: background .1s;
}
.ddrop-menu a:hover, .ddrop-menu button:hover { background: var(--c-bg); text-decoration: none; }
.ddrop-menu button.danger { color: var(--c-danger); }
.ddrop-menu button.danger:hover { background: var(--c-danger-l); }

/* ── Login ─────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-nav-bg);
}
.login-box {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 360px;
}
.login-box h2 { margin-bottom: 28px; text-align: center; font-size: 20px; }

/* ── Utilities ─────────────────────────────── */
.hidden        { display: none; }
.txt-muted     { color: var(--c-muted); }
.flex-1        { flex: 1; }
.btn-block     { width: 100%; }
.inp-mt        { margin-top: 4px; }
.mt-4          { margin-top: 16px; }
.tbl-img       { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.item-row      { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.total-display {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
}
.section-h3    { margin: 12px 0 6px; }
.topbar-left   { display: flex; align-items: center; gap: 12px; }
.page-cols     { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.col-narrow    { flex: 1; min-width: 260px; }
.col-wide      { flex: 2; min-width: 300px; }
.col-stack     { display: flex; flex-direction: column; gap: 16px; }

/* ── Search ─────────────────────────────── */
.search-inp {
  padding-left: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 9px center;
}

/* ── Section panels ─────────────────────────────── */
.section-sep   { margin-top: 18px; border-top: 1px solid var(--c-border); padding-top: 16px; }
.section-label { font-size: 11px; font-weight: bold; letter-spacing: .4px; color: var(--c-muted); margin-bottom: 10px; }
.inline-add-form { display: flex; gap: 6px; margin-top: 8px; }
.phone-item    { display: flex; align-items: center; padding: 7px 10px; background: var(--c-bg); border-radius: var(--r); margin-bottom: 6px; font-size: 13px; gap: 4px; }
.phone-item span:first-child { flex: 1; }
.phone-item-col { align-items: flex-start; }
.phone-item button { background: none; border: none; color: var(--c-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 4px; flex-shrink: 0; }
.phone-item button:hover { color: var(--c-danger); background: var(--c-danger-l); }
.item-edit-btn:hover { color: var(--c-primary) !important; background: var(--c-primary-l) !important; }
.loc-addr      { font-size: 13px; flex: 1; color: var(--c-text); }
.map-btn       { font-size: 16px; text-decoration: none; margin-right: 4px; }
.map-btn:hover { opacity: .75; }

/* ── Toolbar ─────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar .search-wrap { flex: 1; }
.toolbar .inp { width: 100%; }

/* ── Stat cards ─────────────────────────────── */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
  flex: 1;
  min-width: 150px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.stat-val { font-size: 34px; font-weight: bold; color: var(--c-primary); line-height: 1; }
.stat-label { font-size: 13px; color: var(--c-muted); }

/* ── Burger (topbar) ─────────────────────────────── */
.topbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r);
  flex-shrink: 0;
}
.topbar-burger:hover { background: var(--c-bg); }
.topbar-burger span {
  display: block;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: .2s;
}

/* ── Nav overlay ─────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.nav-overlay.open { display: block; }

/* ── Bottom sheet ─────────────────────────────── */
#bs-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 400;
  align-items: flex-end;
  backdrop-filter: blur(2px);
}
#bs-bg.open { display: flex; }
#bs {
  background: var(--c-surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%;
  padding-bottom: env(safe-area-inset-bottom, 12px);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
#bs-bg.open #bs { transform: translateY(0); }
#bs-handle {
  width: 36px; height: 4px;
  background: var(--c-border);
  border-radius: 99px;
  margin: 10px auto 6px;
}
#bs-list a, #bs-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--c-bg);
  font-family: var(--font);
  font-size: 15px;
  color: var(--c-text);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
#bs-list a:last-child, #bs-list button:last-child { border-bottom: none; }
#bs-list button.danger { color: var(--c-danger); }

/* ── Customer profile ─────────────────────────────── */
.cust-profile { display: flex; flex-direction: column; }

.cust-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--c-border);
}
.cust-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.cust-hero-info { min-width: 0; }
.cust-name { font-size: 17px; font-weight: bold; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-note { font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cust-details { flex: 1; padding: 16px 20px; }
.detail-section { margin-bottom: 18px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section-label {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: .6px;
  color: var(--c-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r);
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--c-text);
  text-decoration: none;
  transition: background .12s;
}
a.detail-link:hover { background: var(--c-primary-l); color: var(--c-primary); text-decoration: none; }
.detail-icon { font-size: 14px; flex-shrink: 0; }
.detail-empty { font-size: 13px; padding: 4px 10px; }

.cust-profile-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--c-border);
}

/* ── Card-head action button ────────────────────────── */
.card-head-action { margin-left: auto; }

/* ── Orders count badge ─────────────────────────────── */
.orders-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-primary-l);
  color: var(--c-primary);
  border-radius: 99px;
  font-size: 11px;
  font-weight: bold;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
}

/* ── Clickable table rows ─────────────────────────────── */
.tbl-row-link { cursor: pointer; }
.tbl-row-link:hover td { background: var(--c-primary-l) !important; }
.order-total-cell { font-weight: bold; color: var(--c-text); white-space: nowrap; }

/* ── Price: calculated (struck) + actual (real) ─────────────────────────────── */
.price-calculated {
  display: inline-block;
  font-size: 11px;
  color: var(--c-muted);
  text-decoration: line-through;
  margin-right: 4px;
  font-weight: normal;
}
.price-actual {
  font-weight: bold;
  color: var(--c-text);
}

/* ── Product list / show ─────────────────────────────── */
.product-name-link { font-weight: bold; color: var(--c-text); }
.product-name-link:hover { color: var(--c-primary); text-decoration: none; }

.product-avatar { background: #7c3aed; }   /* distinct colour from customer blue */

.prod-price-label { flex: 1; color: var(--c-muted); font-size: 13px; }
.prod-price-val   { font-weight: bold; font-size: 13px; white-space: nowrap; }

/* ── Orders list ─────────────────────────────── */
.cust-link { font-weight: bold; color: var(--c-text); }
.cust-link:hover { color: var(--c-primary); text-decoration: none; }

.order-items-cell { max-width: 260px; }
.order-items-list { display: flex; flex-wrap: wrap; gap: 4px; }
.order-item-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  font-size: 11px;
  color: var(--c-text);
  white-space: nowrap;
}

/* ── Order address cell ─────────────────────────────── */
.order-addr-cell { max-width: 220px; }
.order-addr-pin  { margin-right: 4px; font-style: normal; }
.order-addr-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-decoration: none;
}
.order-addr-link:hover { color: var(--c-primary); text-decoration: none; }
.order-addr-plain {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Wider modal variant ─────────────────────────────── */
.modal-lg { max-width: 540px; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .nav {
    width: 260px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .nav.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  .topbar-burger  { display: flex; }
  .topbar-uname   { display: none; }
  .mob-hide       { display: none !important; }
  .main    { margin-left: 0; }
  .content { padding: 14px; }
  .modal   { max-width: 100%; border-radius: var(--r); }
  .topbar  { padding: 0 14px; }
  .card-head {
    padding: 12px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    margin-bottom: 8px;
  }
  .card-body { padding: 14px; }

  /* profile card keeps its card look on mobile */
  .cust-profile {
    background: var(--c-surface) !important;
    border: 1px solid var(--c-border) !important;
    box-shadow: var(--shadow) !important;
    border-radius: var(--r-lg) !important;
  }
  /* address cell: let text wrap on mobile */
  .order-addr-cell { max-width: none; }
  .order-addr-link,
  .order-addr-plain { white-space: normal; overflow: visible; text-overflow: clip; }

  /* products column: pills wrap to the right */
  .order-items-cell { max-width: none; }
  .order-items-list { justify-content: flex-end; }

  /* ── Hide actions col + id col, use long-press instead ── */
  .tbl td:last-child,
  .tbl td:first-child { display: none; }

  /* ── Table → Cards on mobile ── */
  .tbl-wrap { overflow-x: visible; padding: 2px; }
  .card { background: transparent; border: none; box-shadow: none; }
  .tbl      { min-width: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }

  .tbl tr {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .tbl tr:last-child { margin-bottom: 0; }

  .tbl td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-bg);
    white-space: normal;
    font-size: 13px;
    gap: 12px;
    background: var(--c-surface);
  }
  .tbl td:last-child { display: none; }
  /* total cell: show and keep label-left / value-right */
  .tbl-detail td:last-child { display: flex; align-items: center; border-bottom: none; }
  .tbl tbody tr:hover td { background: var(--c-surface); }
  /* numeric / price cells: label grows left, value sits at the right edge */
  .tbl td.txt-r,
  .tbl td.txt-c { justify-content: flex-start; text-align: right; }
  .tbl td.txt-r::before,
  .tbl td.txt-c::before { flex: 1; text-align: left; }

  .tbl td::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--c-muted);
  
    letter-spacing: .4px;
    font-weight: bold;
    flex-shrink: 0;
    min-width: 90px;
  }
  .tbl td[data-label=""]::before { display: none; }
  .tbl td:first-child { display: none; }
  .tbl td[data-label="#"] { display: flex; }
}
