/* ==========================================================
   Luxury Nest — Inventory & POS
   Single stylesheet, no external dependencies.
   Brand palette (from the Luxury Nest Aesthetics logo):
     hot pink #ee5fa8 · mustard gold #d9a33c · dusty pink
     #d9a6b6 · near-black details · white/cream ground.
   Note: classes named *-gold are legacy accent hooks used across
   the PHP templates; their values carry the pink brand accent.
   ========================================================== */

:root {
  --accent: #ee5fa8;          /* hot bubblegum pink */
  --accent-bright: #f9b7d6;   /* light pink */
  --accent-dark: #c9337f;     /* deep pink */
  --accent-deep: #a52666;     /* darkest pink (gradients, hovers) */
  --mustard: #d9a33c;         /* gold-yellow secondary */
  --mustard-dark: #a87a1c;
  --ink: #3d2a35;
  --muted: #97808c;
  --bg: #fdf7fa;              /* pink-tinged white */
  --card: #ffffff;
  --line: #f3dfe9;
  --sidebar-top: #fffdfe;     /* sidebar gradient — never a solid block */
  --sidebar-bottom: #fde7f1;
  --danger: #b03b2e;
  --danger-bg: #fbeae7;
  --success: #2e6b3f;
  --success-bg: #e8f3ea;
  --warn: #8a6d1a;
  --warn-bg: #faf3dc;
  --info-bg: #eaf0f6;
  --info: #33526e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(180, 60, 120, 0.08), 0 4px 14px rgba(180, 60, 120, 0.06);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 600; }

/* ----------------------------------------------------------
   App shell
   ---------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-top) 0%, #fef2f8 55%, var(--sidebar-bottom) 100%);
  border-right: 1px solid var(--line);
  color: #6b4f5e;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(201, 51, 127, 0.12);
}

.brand-mark {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 8px;
  box-shadow: 2px 2px 0 var(--mustard); /* nod to the logo's gold drop shadow */
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--serif); font-size: 1.05rem; color: var(--accent-dark); letter-spacing: 0.02em; font-weight: 700; }
.brand-sub { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--mustard-dark); }

.nav { flex: 1; padding: 14px 12px; }

.nav-section {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--mustard-dark);
  padding: 16px 10px 6px;
}

.nav-link {
  display: block;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 999px;
  color: #6b4f5e;
  font-size: 0.9rem;
}
.nav-link:hover { background: rgba(238, 95, 168, 0.1); color: var(--accent-dark); text-decoration: none; }
.nav-link.active {
  background: linear-gradient(90deg, #e2519d, var(--accent-dark));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(201, 51, 127, 0.3);
}

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(201, 51, 127, 0.12); }

.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-name { color: var(--ink); font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--muted); }

/* ----------------------------------------------------------
   Main column
   ---------------------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.page-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.01em; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.branch-switch { display: flex; align-items: center; gap: 8px; }
.branch-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.branch-switch select { padding: 7px 10px; }

.branch-badge {
  background: rgba(238, 95, 168, 0.12);
  border: 1px solid rgba(238, 95, 168, 0.45);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
}

.content { padding: 26px 28px 48px; max-width: 1400px; width: 100%; }

/* ----------------------------------------------------------
   Cards, grids
   ---------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 1rem; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 18px; margin-bottom: 22px; }
.grid > * { min-width: 0; } /* wide tables must scroll inside cards, never widen the page */
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-top: 3px solid var(--accent);
}
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 1.65rem; margin-top: 4px; }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.stat.alert-stat { border-top-color: var(--danger); }
.stat.alert-stat .stat-value { color: var(--danger); }

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fdf2f8; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.table tfoot td { font-weight: 700; background: #fcedf5; }

.thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #f9edf3;
  display: block;
}
.thumb-placeholder {
  width: 40px; height: 40px;
  border-radius: 6px;
  border: 1px dashed var(--line);
  background: #fcf3f8;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
}

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }

/* ----------------------------------------------------------
   Badges
   ---------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-gold { background: rgba(238, 95, 168, 0.14); color: var(--accent-dark); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-gray { background: #f5ebf0; color: var(--muted); }

.qty-pos { color: var(--success); font-weight: 600; }
.qty-neg { color: var(--danger); font-weight: 600; }
.low-qty { color: var(--danger); font-weight: 700; }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */
label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; color: #5c4351; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ebcede;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(238, 95, 168, 0.18);
}
input[disabled], select[disabled] { background: #f8f0f4; color: var(--muted); }
textarea { resize: vertical; min-height: 74px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-row { margin-bottom: 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.hint { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fdf4f9, #fcf0f6);
  border-radius: var(--radius) var(--radius) 0 0;
}
.filter-bar .field { min-width: 140px; flex: 0 1 auto; }
.filter-bar label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.filter-bar input, .filter-bar select { padding: 7px 10px; font-size: 0.85rem; }

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; }

.btn-gold {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent-dark);
  color: #fff;
  box-shadow: 0 3px 10px rgba(201, 51, 127, 0.28);
}
.btn-gold:hover { background: linear-gradient(135deg, #f377b5, var(--accent)); }

.btn-dark { background: #47203a; color: #fdeaf4; border-color: #2f1226; }
.btn-dark:hover { background: #5d2b4c; }

.btn-outline { background: #fff; border-color: #e8c4d7; color: var(--accent-dark); }
.btn-outline:hover { border-color: var(--accent); background: #fdf2f8; }
.sidebar .btn-outline { background: transparent; }

.btn-danger { background: var(--danger); color: #fff; border-color: #8e2f24; }
.btn-danger:hover { background: #c4473a; }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline; }

/* ----------------------------------------------------------
   Alerts
   ---------------------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: #bcd9c3; }
.alert-error, .alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #ecc4bd; }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: #e7d9a4; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c3d2e0; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mono { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.mb0 { margin-bottom: 0; }

/* ----------------------------------------------------------
   Pagination
   ---------------------------------------------------------- */
.pagination { display: flex; gap: 6px; padding: 14px 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink);
}
.pagination .current { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-color: var(--accent-dark); color: #fff; font-weight: 700; }
.pagination a:hover { border-color: var(--accent); text-decoration: none; }

/* ----------------------------------------------------------
   Tabs (reports)
   ---------------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid #e8c4d7;
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark);
}
.tabs a:hover { text-decoration: none; border-color: var(--accent); background: #fdf2f8; }
.tabs a.active {
  background: linear-gradient(90deg, #e2519d, var(--accent-dark));
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: 0 3px 10px rgba(201, 51, 127, 0.3);
}

/* ----------------------------------------------------------
   Login page
   ---------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(217, 163, 60, 0.18), transparent 60%),
    radial-gradient(1100px 600px at 10% 110%, rgba(238, 95, 168, 0.25), transparent 65%),
    linear-gradient(160deg, #fff6fa, #fce3ef 60%, #f9d3e6);
  padding: 20px;
}
.auth-card {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid #f7d8e8;
  box-shadow: 0 20px 60px rgba(201, 51, 127, 0.22);
  padding: 40px 38px 34px;
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  font-family: var(--serif);
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 2px;
  color: var(--accent-dark);
}
.auth-logo span { color: var(--mustard); }
.auth-sub {
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--mustard-dark);
  margin-bottom: 26px;
}
.auth-card .form-row { margin-bottom: 14px; }
.auth-card .btn { margin-top: 8px; }

/* ----------------------------------------------------------
   POS screen
   ---------------------------------------------------------- */
.pos-body { background: var(--bg); }
.pos-shell { display: flex; flex-direction: column; height: 100vh; }

.pos-top {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #fffdfe, #fdeaf3);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.pos-top .brand-mark { width: 34px; height: 34px; font-size: 0.85rem; }
.pos-title { font-family: var(--serif); font-size: 1.05rem; color: var(--accent-dark); font-weight: 700; }
.pos-branch { font-size: 0.75rem; color: var(--mustard-dark); }
.pos-top .spacer { flex: 1; }
.pos-top a { color: #6b4f5e; font-size: 0.85rem; font-weight: 600; }
.pos-top a:hover { color: var(--accent-dark); }

.pos-main { flex: 1; display: flex; min-height: 0; }

.pos-left { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 14px; }

.pos-search { position: relative; margin-bottom: 12px; }
.pos-search input {
  padding: 14px 16px;
  font-size: 1.05rem;
  border-radius: 999px;
  border: 2px solid #ebcede;
}
.pos-search input:focus { border-color: var(--accent); }

.pos-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  align-content: start;
  padding-bottom: 20px;
}

.pos-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: border-color 0.12s, transform 0.08s, box-shadow 0.12s;
}
.pos-item:hover { border-color: var(--accent); box-shadow: 0 3px 12px rgba(238, 95, 168, 0.18); }
.pos-item:active { transform: scale(0.97); }
.pos-item.out { opacity: 0.45; cursor: not-allowed; }
.pos-item-img {
  height: 74px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  background: #fcf3f8;
  border-radius: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.65rem;
}
.pos-item-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-item-name {
  font-size: 0.8rem; font-weight: 600; line-height: 1.25;
  height: 2.5em; overflow: hidden;
}
.pos-item-price { color: var(--accent-dark); font-weight: 700; font-size: 0.9rem; margin-top: 4px; }
.pos-item-stock { font-size: 0.68rem; color: var(--muted); }

.pos-cart {
  width: 390px;
  flex-shrink: 0;
  background: var(--card);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.pos-cart-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.pos-cart-head h2 { font-size: 0.95rem; }

.pos-cart-items { flex: 1; overflow-y: auto; }
.cart-line {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.cart-line-name { flex: 1; min-width: 0; }
.cart-line-name .nm { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line-name .pr { color: var(--muted); font-size: 0.75rem; }
.cart-qty { display: flex; align-items: center; gap: 4px; }
.cart-qty button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid #e8c4d7;
  background: #fdf2f8;
  color: var(--accent-dark);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.cart-qty button:hover { border-color: var(--accent); background: #fce3ef; }
.cart-qty input {
  width: 48px; text-align: center; padding: 5px 4px; font-size: 0.9rem;
  -moz-appearance: textfield;
}
.cart-qty input::-webkit-outer-spin-button, .cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cart-line-total { width: 72px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-remove {
  width: 26px; height: 26px;
  border: none; background: none;
  color: var(--danger);
  font-size: 1.1rem; cursor: pointer;
  border-radius: 5px;
}
.cart-remove:hover { background: var(--danger-bg); }
.cart-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 0.88rem; }

.pos-summary { border-top: 2px solid var(--line); padding: 12px 16px 16px; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 0.9rem; }
.sum-row.total { font-size: 1.3rem; font-weight: 700; padding: 8px 0; }
.sum-row.total .amount { color: var(--accent-dark); font-family: var(--serif); }
.sum-row .mini-input { width: 110px; }
.sum-row .mini-input input { padding: 6px 9px; text-align: right; font-size: 0.9rem; }
.sum-row.change-row { color: var(--success); font-weight: 700; }

.pay-methods { display: flex; gap: 8px; margin: 10px 0; }
.pay-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: 999px;
  border: 2px solid #ebcede;
  background: #fff;
  font: inherit; font-size: 0.82rem; font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b4f5e;
}
.pay-btn.selected { border-color: var(--accent-dark); background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }

.pos-complete {
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  border-radius: 999px;
  margin-top: 6px;
}
.pos-error { color: var(--danger); font-size: 0.83rem; margin-top: 8px; min-height: 1.2em; }

.cart-mini { display: none; font-weight: 600; color: var(--accent-dark); font-size: 0.85rem; }

/* Tablets / small laptops: narrower cart, denser grid */
@media (max-width: 1180px) {
  .pos-cart { width: 330px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* Phones / portrait tablets: bottom-sheet cart */
@media (max-width: 900px) {
  .pos-shell { height: auto; min-height: 100vh; }
  .pos-main { flex-direction: column; }
  .pos-left { padding: 10px 10px 0; }
  .pos-search input { padding: 12px 14px; font-size: 16px; }
  .pos-grid {
    overflow: visible;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 8px;
    padding-bottom: 110px; /* keep last row above the cart bar */
  }
  .pos-item-img { height: 58px; }
  .pos-top { flex-wrap: wrap; row-gap: 2px; padding: 8px 12px; gap: 10px; }
  .pos-top .pos-title { display: none; } /* the logo already says who we are */
  .pos-branch { font-size: 0.8rem; }
  .pos-top a { font-size: 0.78rem; }

  .pos-cart {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 80vh;
    z-index: 45;
    border-left: none;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(61, 42, 53, 0.22);
    transform: translateY(calc(100% - 62px)); /* only the header strip peeks out */
    transition: transform 0.25s ease;
  }
  .pos-cart.cart-open { transform: none; }
  .pos-cart-head { min-height: 62px; cursor: pointer; }
  .cart-mini { display: inline; }
  .pos-cart-items { min-height: 0; }
  .cart-qty button { width: 38px; height: 38px; }
  .cart-qty input { width: 54px; padding: 8px 4px; font-size: 16px; }
  .pay-btn { padding: 13px 6px; }
  .sum-row .mini-input input, #tendered, #discount { font-size: 16px; }
  .customer-row input { font-size: 16px; }
}

/* ----------------------------------------------------------
   Receipt (80mm thermal)
   ---------------------------------------------------------- */
.receipt-page { background: #f8ebf2; min-height: 100vh; padding: 26px 10px; font-family: var(--sans); }
.receipt-tools { max-width: 320px; margin: 0 auto 16px; display: flex; gap: 8px; flex-wrap: wrap; }

.receipt {
  width: 302px; /* ~80mm */
  margin: 0 auto;
  background: #fff;
  padding: 16px 14px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.35;
  color: #000;
  box-shadow: var(--shadow);
}
.receipt-center { text-align: center; }
.receipt-company { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.receipt hr { border: none; border-top: 1px dashed #000; margin: 7px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt .r { text-align: right; white-space: nowrap; }
.receipt .receipt-total td { font-size: 14px; font-weight: 700; padding-top: 3px; }
.receipt-foot { margin-top: 8px; text-align: center; white-space: pre-line; }
.receipt-barcode { padding: 2px 10px 4px; }
.receipt-barcode svg { width: 100%; max-width: 220px; height: 34px; }

/* ----------------------------------------------------------
   Printable documents (GRN / transfer)
   ---------------------------------------------------------- */
.doc-page { background: #f8ebf2; min-height: 100vh; padding: 26px 12px; }
.doc-tools { max-width: 820px; margin: 0 auto 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.doc {
  max-width: 820px;
  margin: 0 auto;
  background: #fff;
  padding: 38px 42px;
  box-shadow: var(--shadow);
}
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--accent); padding-bottom: 16px; margin-bottom: 20px; }
.doc-company { font-family: var(--serif); font-size: 1.5rem; color: var(--accent-dark); }
.doc-type { text-align: right; }
.doc-type h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--mustard-dark); }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; font-size: 0.9rem; }
.doc-meta .lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); display: block; }
.doc table.table td, .doc table.table th { padding: 8px 10px; }

@media print {
  body { background: #fff !important; }
  .receipt-page, .doc-page { background: #fff; padding: 0; }
  .receipt-tools, .doc-tools, .no-print { display: none !important; }
  .receipt, .doc { box-shadow: none; margin: 0; width: auto; max-width: none; padding: 0; }
  .receipt { width: 72mm; }
  @page { margin: 6mm; }
}

/* ----------------------------------------------------------
   Line-item editor (purchases / transfers)
   ---------------------------------------------------------- */
.lines-table select { min-width: 220px; }
.lines-table input[type="number"] { width: 110px; }
.line-remove {
  border: none; background: none; color: var(--danger);
  font-size: 1.15rem; cursor: pointer; padding: 4px 8px; border-radius: 5px;
}
.line-remove:hover { background: var(--danger-bg); }
.avail-hint { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.avail-hint.short { color: var(--danger); font-weight: 700; }

/* ----------------------------------------------------------
   v1.1 — uploaded branding (logo in sidebar / login / POS / prints)
   ---------------------------------------------------------- */
.brand-with-logo {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.brand-logo { max-width: 170px; max-height: 64px; object-fit: contain; }

.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { max-width: 220px; max-height: 90px; object-fit: contain; }

.pos-logo { height: 36px; max-width: 130px; object-fit: contain; }

.receipt-logo { max-width: 170px; max-height: 70px; object-fit: contain; margin-bottom: 4px; }

.doc-logo { max-height: 60px; max-width: 220px; object-fit: contain; display: block; margin-bottom: 6px; }

/* ----------------------------------------------------------
   v1.1 — sidebar icons
   ---------------------------------------------------------- */
.nav-link { display: flex; align-items: center; gap: 10px; }
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.7; }
.nav-link:hover svg { opacity: 1; }
.nav-link.active svg { opacity: 1; }

/* ----------------------------------------------------------
   v1.1 — alerts: dismissible + entrance animation
   ---------------------------------------------------------- */
@keyframes alert-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.alert { cursor: pointer; animation: alert-in 0.25s ease-out; }

/* ----------------------------------------------------------
   v1.1 — POS category chips, customer fields, held sales
   ---------------------------------------------------------- */
.chip-row {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 8px; margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid #ebcede;
  background: #fff;
  font: inherit; font-size: 0.8rem; font-weight: 700;
  color: #6b4f5e;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.chip.active {
  background: linear-gradient(90deg, #e2519d, var(--accent-dark));
  color: #fff; border-color: var(--accent-dark);
}

.pos-actions { display: flex; gap: 8px; }
.customer-row { display: flex; gap: 8px; margin: 8px 0 2px; }
.customer-row input { padding: 7px 10px; font-size: 0.83rem; border-radius: 999px; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(61, 42, 53, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(61, 42, 53, 0.35);
  width: 100%; max-width: 460px;
  max-height: 80vh;
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 1rem; }
.modal-close { border: none; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.modal-close:hover { background: #fdf2f8; color: var(--accent-dark); }
.modal-body { overflow-y: auto; padding: 8px 0; }
.held-line {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.87rem;
}
.held-line .meta { flex: 1; min-width: 0; }
.held-line .meta strong { display: block; }
.held-line .meta span { font-size: 0.76rem; color: var(--muted); }
.held-empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: 0.87rem; }

/* ----------------------------------------------------------
   v1.1 — dashboard sales chart
   ---------------------------------------------------------- */
.chart-wrap { padding: 12px 20px 6px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-bar { transition: opacity 0.12s; }
.chart-bar:hover { opacity: 0.75; }

/* ----------------------------------------------------------
   v1.1 — voided sales
   ---------------------------------------------------------- */
.receipt { position: relative; }
.voided-stamp {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  border: 3px solid #b03b2e;
  color: #b03b2e;
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  padding: 6px 22px;
  border-radius: 8px;
  opacity: 0.55;
  pointer-events: none;
}
tr.voided-row td { opacity: 0.55; text-decoration: line-through; }
tr.voided-row td:last-child, tr.voided-row td .badge { text-decoration: none; }

/* ----------------------------------------------------------
   v1.1 — barcode labels
   ---------------------------------------------------------- */
.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  padding: 16px;
}
.label {
  border: 1px dashed #d9b8c9;
  border-radius: 6px;
  padding: 10px 8px 8px;
  text-align: center;
  background: #fff;
  break-inside: avoid;
}
.label-company { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-dark); font-weight: 700; }
.label-name {
  font-size: 0.76rem; font-weight: 600; line-height: 1.2;
  height: 2.4em; overflow: hidden;
  margin: 2px 0 4px;
}
.label-price { font-size: 0.95rem; font-weight: 800; margin-bottom: 4px; }
.label svg { width: 100%; height: 44px; }
.label-code { font-family: "Courier New", monospace; font-size: 0.68rem; letter-spacing: 0.08em; }

@media print {
  .label-grid { grid-template-columns: repeat(4, 1fr); gap: 4mm; padding: 0; }
  .label { border: 1px dashed #999; border-radius: 0; }
  .label-company { color: #000; }
  .sidebar, .topbar, .filter-bar, .mobile-bar, .nav-backdrop, .no-print { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; }
}

/* ----------------------------------------------------------
   Responsive shell — slide-in drawer navigation
   ---------------------------------------------------------- */
.mobile-bar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  .app { flex-direction: column; }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(90deg, #fffdfe, #fdeaf3);
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
  }
  .nav-toggle {
    width: 42px; height: 42px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #e8c4d7;
    border-radius: 10px;
    background: #fff;
    color: var(--accent-dark);
    cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .mobile-brand {
    flex: 1;
    font-family: var(--serif);
    font-weight: 700;
    color: var(--accent-dark);
    font-size: 1.05rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-width: 84vw;
    height: 100vh;
    z-index: 60;
    border-right: 1px solid var(--line);
    box-shadow: 12px 0 40px rgba(61, 42, 53, 0.25);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }
  body.nav-open .sidebar { transform: none; }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(61, 42, 53, 0.45);
    z-index: 50;
  }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }

  .main { overflow-x: hidden; } /* column-flex min-content floor: keep page at viewport width */
  .topbar { padding: 12px 14px; }
  .page-title { font-size: 1.15rem; }
  .content { padding: 16px 12px 56px; }

  .grid-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 1.35rem; }

  /* Larger touch targets, no iOS focus-zoom */
  input[type="text"], input[type="password"], input[type="number"], input[type="date"],
  input[type="email"], input[type="search"], select, textarea { font-size: 16px; }
  .btn { padding: 11px 18px; }
  .btn-sm { padding: 8px 13px; }
  .filter-bar { padding: 12px 12px; gap: 10px; }
  .filter-bar .field { flex: 1 1 45%; min-width: 130px; }
  .table td { padding: 10px 10px; }
  .table th { padding: 10px 10px; }
  .card-body { padding: 14px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
