/* ============================================================
   POS System – Odoo Enterprise Inspired UI
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --primary:         #875A7B;
  --primary-dark:    #6B4461;
  --primary-light:   #F3EEF1;
  --sidebar-bg:      #2B2838;
  --sidebar-hover:   rgba(255,255,255,.06);
  --sidebar-active-bg: rgba(135,90,123,.18);
  --sidebar-border:  #875A7B;
  --sidebar-text:    rgba(255,255,255,.72);
  --sidebar-width:   230px;
  --navbar-bg:       #FFFFFF;
  --navbar-border:   #E8E0E6;
  --body-bg:         #F5F4F6;
  --card-bg:         #FFFFFF;
  --card-radius:     8px;
  --card-shadow:     0 1px 6px rgba(0,0,0,.08);
  --border-color:    #E5E0E8;
  --text:            #2C2C3A;
  --text-muted:      #8B85A0;
  --accent:          #875A7B;
  --success:         #22a67a;
  --danger:          #e24c4c;
  --warning:         #f0a500;
  --info:            #0e87cc;
}

/* ── Base ──────────────────────────────────────────────── */
body {
  background: var(--body-bg);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
}

/* ── Navbar ────────────────────────────────────────────── */
.pos-navbar {
  background: var(--navbar-bg) !important;
  height: 54px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1050;
  border-bottom: 1px solid var(--navbar-border);
  box-shadow: 0 1px 8px rgba(135,90,123,.1);
}
.pos-navbar .navbar-brand {
  color: var(--primary) !important;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.3px;
}
.pos-navbar .nav-user-name { color: var(--text); font-size: 13px; font-weight: 500; }
.pos-navbar .badge-role {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  font-size: 10px; padding: 2px 7px; border-radius: 20px;
}
.pos-navbar .btn-nav-pos {
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  transition: background .15s;
}
.pos-navbar .btn-nav-pos:hover { background: var(--primary-dark); color: #fff; }

/* ── Sidebar ───────────────────────────────────────────── */
#wrapper { padding-top: 54px; }

.pos-sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-width);
  min-height: calc(100vh - 54px);
  position: fixed;
  top: 54px; left: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: width .22s ease;
  z-index: 1040;
  border-right: 1px solid rgba(255,255,255,.05);
}
.pos-sidebar::-webkit-scrollbar { width: 4px; }
.pos-sidebar::-webkit-scrollbar-track { background: transparent; }
.pos-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.pos-sidebar .sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.pos-sidebar .sidebar-brand .brand-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; flex-shrink: 0;
}
.pos-sidebar .brand-text { color: #fff; font-weight: 700; font-size: 15px; }
.pos-sidebar .brand-sub  { color: rgba(255,255,255,.4); font-size: 11px; }

.pos-sidebar .sidebar-section-title {
  color: rgba(255,255,255,.3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 16px 4px;
}

.pos-sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 7px;
  padding: 9px 14px;
  margin: 1px 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: all .15s;
  font-size: 13.5px;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.pos-sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.pos-sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--sidebar-border);
}
.pos-sidebar .nav-icon {
  width: 18px; text-align: center; font-size: 14px; flex-shrink: 0;
}
.pos-sidebar .sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 16px;
  color: rgba(255,255,255,.3);
  font-size: 11px;
}

/* Page content offset */
#page-content { margin-left: var(--sidebar-width); transition: margin .22s; }

/* ── Sidebar collapsed ─────────────────────────────────── */
body.sidebar-collapsed .pos-sidebar { width: 56px; }
body.sidebar-collapsed .pos-sidebar .nav-label,
body.sidebar-collapsed .pos-sidebar .brand-text,
body.sidebar-collapsed .pos-sidebar .brand-sub,
body.sidebar-collapsed .pos-sidebar .sidebar-section-title,
body.sidebar-collapsed .pos-sidebar .sidebar-footer,
body.sidebar-collapsed .pos-sidebar .sidebar-badge { display: none; }
body.sidebar-collapsed #page-content { margin-left: 56px; }
body.sidebar-collapsed .pos-sidebar .nav-link {
  justify-content: center; padding: 10px 0; margin: 1px 4px;
  border-left-color: transparent;
}
body.sidebar-collapsed .pos-sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  border-radius: 7px;
}
body.sidebar-collapsed .pos-sidebar .sidebar-brand { justify-content: center; padding: 16px 0; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  background: var(--card-bg);
}
.card-header {
  background: #FBFAFC;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  font-weight: 600;
  color: var(--text);
  padding: 12px 16px;
}

/* ── Stat Cards (Dashboard) ─────────────────────────────── */
.stat-card {
  border-radius: var(--card-radius);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(135,90,123,.15); transform: translateY(-2px); }
.stat-card .stat-icon {
  width: 54px; height: 54px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; flex-shrink: 0;
}
.stat-card .stat-body { flex: 1; min-width: 0; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.stat-card .stat-trend { font-size: 11px; margin-top: 4px; }

/* ── POS Terminal ───────────────────────────────────────── */
.pos-wrapper {
  display: flex;
  height: calc(100vh - 80px);
  gap: 0;
  background: var(--body-bg);
}

/* Products panel */
.pos-products-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius) 0 0 var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.pos-top-bar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: #FBFAFC;
}
.pos-top-bar .form-control {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 8px 16px 8px 38px;
  font-size: 13.5px;
  transition: border-color .15s;
}
.pos-top-bar .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(135,90,123,.12);
}
.pos-search-wrap { position: relative; }
.pos-search-wrap .search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
}

.pos-categories {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
  scrollbar-width: none;
}
.pos-categories::-webkit-scrollbar { display: none; }
.pos-cat-btn {
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.pos-cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pos-cat-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Product tile */
.product-tile {
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .18s;
  background: #fff;
  position: relative;
  user-select: none;
}
.product-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(135,90,123,.18);
  transform: translateY(-3px);
}
.product-tile:active { transform: translateY(-1px); }
.product-tile.oos { opacity: .55; cursor: not-allowed; }
.product-tile .pt-img-wrap {
  position: relative;
  background: #F8F6FA;
  overflow: hidden;
}
.product-tile img {
  width: 100%; height: 115px; object-fit: cover;
  display: block; transition: transform .2s;
}
.product-tile:hover img { transform: scale(1.04); }
.product-tile .pt-body { padding: 9px 10px; }
.product-tile .pt-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  line-height: 1.35; margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  min-height: 32px;
}
.product-tile .pt-price {
  font-size: 14px; color: var(--primary); font-weight: 700;
}
.product-tile .pt-sku { font-size: 10px; color: var(--text-muted); }
.product-tile .pt-stock { font-size: 11px; color: var(--text-muted); }
.product-tile .oos-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.65);
  display: flex; align-items: center; justify-content: center;
}
.product-tile .pt-add-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--primary); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; opacity: 0; transition: opacity .15s;
}
.product-tile:hover .pt-add-badge { opacity: 1; }

/* Cart panel */
.pos-cart-panel {
  width: 345px; min-width: 320px;
  background: #FAFAF8;
  display: flex; flex-direction: column;
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
  box-shadow: var(--card-shadow);
}
.cart-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.cart-items { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; }

/* Cart item row */
.cart-item {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 6px;
  transition: border-color .15s;
}
.cart-item:hover { border-color: var(--primary); }
.cart-item .ci-name {
  font-weight: 600; font-size: 13px; color: var(--text); line-height: 1.3;
}
.cart-item .ci-price { font-size: 12px; color: var(--text-muted); }
.ci-qty-ctrl { display: flex; align-items: center; gap: 6px; }
.ci-qty-ctrl button {
  width: 28px; height: 28px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 50%; font-size: 15px; line-height: 1;
  cursor: pointer; color: var(--primary); font-weight: 700;
  transition: all .12s; display: flex; align-items: center; justify-content: center;
}
.ci-qty-ctrl button:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.ci-qty-ctrl input {
  width: 44px; text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 6px; font-size: 13px; padding: 3px;
  color: var(--text); font-weight: 600;
}
.ci-total { font-weight: 700; color: var(--text); font-size: 14px; }
.ci-remove {
  color: var(--text-muted); background: none; border: none;
  cursor: pointer; font-size: 15px; padding: 2px 4px;
  border-radius: 4px; transition: all .12s;
}
.ci-remove:hover { color: var(--danger); background: #fef2f2; }

/* Cart totals */
.cart-totals {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: #fff;
}
.totals-row {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 5px; color: var(--text-muted);
}
.totals-row .label { }
.totals-row .val { font-weight: 600; color: var(--text); }
.totals-row.grand {
  font-size: 18px; font-weight: 700; color: var(--text);
  border-top: 2px solid var(--border-color);
  padding-top: 10px; margin-top: 6px;
}
.btn-checkout {
  width: 100%; padding: 13px; font-size: 15px; font-weight: 700;
  border-radius: 8px; background: var(--primary); border-color: var(--primary);
  letter-spacing: .3px; transition: all .15s;
}
.btn-checkout:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-checkout:active { transform: scale(.98); }

/* ── Tables ─────────────────────────────────────────────── */
.table th {
  background: #FAFAF8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--text-muted);
  text-transform: uppercase;
  border-color: var(--border-color);
}
.table td { vertical-align: middle; font-size: 13px; border-color: var(--border-color); }
.table-hover tbody tr:hover { background: var(--primary-light) !important; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { font-weight: 600; border-radius: 20px; padding: 3px 10px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ── Form helpers ─────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 12.5px; color: var(--text); margin-bottom: 4px; }
.required::after { content: ' *'; color: var(--danger); }
.form-control, .form-select {
  border-color: var(--border-color); border-radius: 6px;
  font-size: 13.5px; color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(135,90,123,.12);
}

/* ── Receipt print styles ─────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .receipt-wrapper {
    width: 80mm; margin: 0 auto;
    font-family: 'Courier New', monospace; font-size: 12px;
  }
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.page-header h4 {
  margin: 0; font-weight: 700; color: var(--text);
  font-size: 20px; letter-spacing: -.3px;
}

/* ── Payment method buttons (checkout modal) ──────────────── */
.pay-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-method-btn {
  border: 2px solid var(--border-color);
  border-radius: 9px;
  background: #fff;
  padding: 12px 8px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-muted);
  text-align: center;
}
.pay-method-btn:hover { border-color: var(--primary); color: var(--primary); }
.pay-method-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Numpad ────────────────────────────────────────────────── */
.numpad-display {
  background: var(--sidebar-bg);
  color: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  text-align: center;
}
.numpad-display .numpad-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .6; }
.numpad-display .numpad-amount { font-size: 32px; font-weight: 700; letter-spacing: -1px; }

.quick-cash-row {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.quick-cash-btn {
  flex: 1; min-width: 60px;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid var(--primary); border-radius: 6px;
  padding: 7px 4px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .12s;
}
.quick-cash-btn:hover { background: var(--primary); color: #fff; }

.numpad-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 12px;
}
.numpad-key {
  background: #FAFAF8;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 8px;
  font-size: 18px; font-weight: 600;
  cursor: pointer; transition: all .12s;
  text-align: center; color: var(--text);
  user-select: none;
}
.numpad-key:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.numpad-key:active { transform: scale(.94); }
.numpad-key.key-backspace { font-size: 20px; color: var(--danger); }
.numpad-key.key-backspace:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }

.change-display {
  background: #F0FDF4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700;
  color: var(--success);
  font-size: 15px;
}
.change-display.negative { background: #FEF2F2; border-color: #fecaca; color: var(--danger); }

/* ── Misc ─────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.img-product-thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 7px; background: var(--primary-light);
  border: 1px solid var(--border-color);
}
.spinner-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.35); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.text-primary { color: var(--primary) !important; }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border-radius: var(--card-radius); font-size: 13.5px; }

/* ── Login page ───────────────────────────────────────────── */
.login-page { min-height: 100vh; background: linear-gradient(135deg, #2B2838 0%, #3D2B5E 100%); }


/* ── Sidebar ───────────────────────────────────────────── */
#wrapper { padding-top: 52px; }

.pos-sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-width);
  min-height: calc(100vh - 52px);
  position: fixed;
  top: 52px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: width .25s ease;
  z-index: 1040;
}

.pos-sidebar .sidebar-brand {
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 16px;
  white-space: nowrap;
}

.pos-sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s;
}
.pos-sidebar .nav-link:hover  { background: var(--sidebar-hover); color: #fff; }
.pos-sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.pos-sidebar .nav-icon { width: 18px; text-align: center; font-size: 15px; }
.pos-sidebar .sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); }

/* Page content offset for sidebar */
#page-content { margin-left: var(--sidebar-width); transition: margin .25s; }

/* ── Sidebar collapsed (mobile / toggled) ─────────────── */
body.sidebar-collapsed .pos-sidebar { width: 60px; }
body.sidebar-collapsed .pos-sidebar .nav-label,
body.sidebar-collapsed .pos-sidebar .brand-text,
body.sidebar-collapsed .pos-sidebar .sidebar-footer { display: none; }
body.sidebar-collapsed #page-content { margin-left: 60px; }
body.sidebar-collapsed .pos-sidebar .nav-link { justify-content: center; padding: 10px 0; }

/* ── Cards ─────────────────────────────────────────────── */
.card  { border: none; border-radius: var(--card-radius); box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.card-header { border-radius: var(--card-radius) var(--card-radius) 0 0 !important; }

/* ── Stat Cards (Dashboard) ────────────────────────────── */
.stat-card { border-radius: var(--card-radius); padding: 20px; color: #fff; }
.stat-card .stat-icon { font-size: 36px; opacity: .4; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; opacity: .85; }

/* ── POS Terminal ───────────────────────────────────────── */
.pos-wrapper { display: flex; gap: 0; height: calc(100vh - 80px); }

/* Products panel */
.pos-products-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--card-radius) 0 0 var(--card-radius);
  overflow: hidden;
}
.pos-top-bar {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.pos-categories { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid #e2e8f0; }
.pos-cat-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.pos-cat-btn:hover, .pos-cat-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-content: start;
}

/* Product card */
.product-tile {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
  background: #fff;
  position: relative;
}
.product-tile:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(37,99,235,.15); transform: translateY(-2px); }
.product-tile.oos  { opacity: .55; cursor: not-allowed; }
.product-tile img  { width: 100%; height: 110px; object-fit: cover; background: #f1f5f9; }
.product-tile .pt-body { padding: 8px; }
.product-tile .pt-name  { font-size: 12px; font-weight: 600; color: #1e293b; line-height: 1.3; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-tile .pt-price { font-size: 14px; color: var(--accent); font-weight: 700; }
.product-tile .pt-stock { font-size: 11px; color: #94a3b8; }


/* ══════════════════════════════════════════════════════════════════════════
   ODOO ENTERPRISE INSPIRED LAYOUT  (v2)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Variables (extend) ─────────────────────────────────── */
:root {
  --topbar-h:   52px;
  --modtabs-h:  42px;
  --osb-w:      240px;
  --osb-w-sm:   64px;
}

/* ── Odoo Top Bar ────────────────────────────────────────── */
.odoo-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #E8E0E6;
  box-shadow: 0 1px 6px rgba(135,90,123,.1);
  z-index: 1060;
  display: flex;
  align-items: center;
  padding: 0 16px 0 0;
  gap: 0;
}

/* App-menu grid button */
.otb-appbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: var(--topbar-h);
  flex-shrink: 0;
  text-decoration: none;
  border-right: 1px solid #E8E0E6;
  transition: background .15s;
}
.otb-appbtn:hover { background: var(--primary-light); }
.otb-appbtn-grid {
  display: grid;
  grid-template-columns: repeat(3,6px);
  grid-template-rows: repeat(3,6px);
  gap: 3px;
}
.otb-appbtn-grid span {
  width: 6px; height: 6px;
  border-radius: 1.5px;
  background: var(--primary);
  transition: background .15s;
}
.otb-appbtn:hover .otb-appbtn-grid span { background: var(--primary-dark); }

/* Brand area */
.otb-left {
  display: flex;
  align-items: center;
  padding-left: 14px;
  flex: 1;
  gap: 10px;
  overflow: hidden;
}
.otb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.otb-brand-icon {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.otb-brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  white-space: nowrap;
}
.otb-sep   { color: #bbb; font-size: 18px; }
.otb-modname {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Right side */
.otb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.otb-action-btn {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
}
.otb-pos-btn {
  background: var(--primary);
  color: #fff !important;
}
.otb-pos-btn:hover { background: var(--primary-dark); }
.otb-divider {
  width: 1px; height: 26px;
  background: #E8E0E6;
  margin: 0 4px;
}

/* User button */
.otb-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all .15s;
}
.otb-user-btn:hover { background: var(--primary-light); border-color: var(--border-color); }
.otb-user-btn::after { display: none; }
.otb-user-btn.dropdown-toggle::after { display: inline-block; margin-left: 4px; }
.otb-avatar {
  width: 32px; height: 32px;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--primary);
  flex-shrink: 0;
}
.otb-user-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.otb-user-role { font-size: 10px; color: var(--text-muted); line-height: 1.2; }

/* ── Module Tab Bar ──────────────────────────────────────── */
.odoo-modtabs {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: var(--modtabs-h);
  background: var(--primary);
  z-index: 1050;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.odoo-modtabs::-webkit-scrollbar { display: none; }
.odoo-modtabs-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: calc(var(--osb-w) + 16px);
  gap: 2px;
  white-space: nowrap;
}

/* Body collapsed modifier */
body.sidebar-collapsed .odoo-modtabs-inner { padding-left: calc(var(--osb-w-sm) + 16px); }

.omt-tab {
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: 100%;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.omt-tab:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.omt-tab.active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.15);
}

/* ── Layout offsets ──────────────────────────────────────── */
#wrapper {
  padding-top: var(--topbar-h);
}
body.has-modtabs #wrapper {
  padding-top: calc(var(--topbar-h) + var(--modtabs-h));
}

/* ── Odoo Sidebar ────────────────────────────────────────── */
.odoo-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0; bottom: 0;
  width: var(--osb-w);
  background: #2B2838;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1040;
  transition: width .22s ease, transform .22s ease;
  border-right: 1px solid rgba(255,255,255,.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
body.has-modtabs .odoo-sidebar { top: calc(var(--topbar-h) + var(--modtabs-h)); }

.odoo-sidebar::-webkit-scrollbar { width: 4px; }
.odoo-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* Module accent strip */
.osb-module-accent {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.osb-module-label {
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* Nav wrapper */
.osb-nav-wrap { padding: 8px 0 4px; }

/* Section header */
.osb-section-header {
  padding: 10px 16px 3px;
}
.osb-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
}

/* Nav link */
.osb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  margin: 1px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,.72);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.osb-link:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}
.osb-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--item-color, var(--primary));
}

/* Icon box */
.osb-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  color: rgba(255,255,255,.75);
  flex-shrink: 0;
  transition: background .15s;
}
.osb-link:hover .osb-icon { background: rgba(255,255,255,.14); color: #fff; }
.osb-link.active .osb-icon { color: #fff; }

.osb-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* Badge */
.osb-badge {
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}

/* Footer */
.osb-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.28);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.osb-footer-dot {
  width: 7px; height: 7px;
  background: #22a67a;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(34,166,122,.25);
}

/* Toggle button (mobile) */
.osb-toggle {
  display: none;
  position: absolute;
  top: 8px; right: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
}

/* Overlay (mobile) */
.osb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1035;
}
.osb-overlay.show { display: block; }

/* Page content offset */
#page-content { margin-left: var(--osb-w); }

/* ── Sidebar Collapsed ───────────────────────────────────── */
body.sidebar-collapsed .odoo-sidebar { width: var(--osb-w-sm); }
body.sidebar-collapsed #page-content { margin-left: var(--osb-w-sm); }
body.sidebar-collapsed .osb-module-accent { padding: 14px 8px; justify-content: center; }
body.sidebar-collapsed .osb-module-label .fa-* { margin: 0; }
body.sidebar-collapsed .osb-module-label span,
body.sidebar-collapsed .osb-label,
body.sidebar-collapsed .osb-badge,
body.sidebar-collapsed .osb-section-title,
body.sidebar-collapsed .osb-footer,
body.sidebar-collapsed .osb-module-label { font-size: 0; }
body.sidebar-collapsed .osb-module-label i { font-size: 16px; }
body.sidebar-collapsed .osb-link {
  justify-content: center;
  padding: 10px 0;
  margin: 1px 6px;
  border-left-color: transparent;
}
body.sidebar-collapsed .osb-link.active { border-radius: 8px; }
body.sidebar-collapsed .osb-icon { width: 32px; height: 32px; font-size: 14px; }
body.sidebar-collapsed .osb-section-header { padding: 6px 0; }

/* ── Odoo Home Screen ────────────────────────────────────── */
.odoo-home {
  min-height: calc(100vh - var(--topbar-h));
  background: var(--body-bg);
}
.odoo-home-header {
  padding: 48px 40px 24px;
  text-align: center;
}
.odoo-home-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.odoo-home-sub {
  color: var(--text-muted);
  font-size: 14px;
}
.odoo-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding: 24px 40px 48px;
  max-width: 1100px;
  margin: 0 auto;
}
.odoo-app-tile {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 28px 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
}
.odoo-app-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--tile-color, var(--primary));
  border-radius: 12px 12px 0 0;
}
.odoo-app-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border-color: var(--tile-color, var(--primary));
  text-decoration: none;
}
.odoo-app-icon {
  width: 68px; height: 68px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.odoo-app-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.odoo-app-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ── Settings – Odoo module tabs ─────────────────────────── */
/* ── Settings Layout ─────────────────────────────────────────── */
.odoo-settings-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--topbar-h) - 80px);
  background: #fff;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.odoo-settings-nav {
  width: 240px;
  flex-shrink: 0;
  background: #FAFAFA;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.odoo-settings-nav-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.odoo-settings-nav-header i { color: var(--primary); font-size: 16px; }
.osn-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.osn-search input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 12px 6px 30px;
  font-size: 12.5px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B85A0' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 10px center;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.osn-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(135,90,123,.1);
}
.osn-nav-scroll { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.osn-group-label {
  padding: 14px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #b0a8be;
  user-select: none;
}
/* FIX: border:none BEFORE border-left so active indicator works */
.osn-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  width: 100%;
  text-align: left;
  transition: background .12s, color .12s;
}
.osn-tab:hover {
  background: rgba(135,90,123,.07);
  color: var(--primary);
}
.osn-tab:hover i { color: var(--primary); }
.osn-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
.osn-tab i {
  width: 18px;
  text-align: center;
  font-size: 13px;
  color: #a89ab8;
  flex-shrink: 0;
  transition: color .12s;
}
.osn-tab.active i { color: var(--primary); }
.osn-tab-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.odoo-settings-body {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Settings pane show/hide */
.settings-pane { display: none; flex: 1; flex-direction: column; }
.settings-pane.active { display: flex; }
.settings-pane-scroll { flex: 1; overflow-y: auto; padding: 28px 32px 100px; }

/* Section cards within panes */
.setting-section {
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.setting-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-color);
}
.setting-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.setting-section-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.setting-section-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.setting-section-body { padding: 20px 20px; }

/* Sticky save bar */
.settings-save-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border-color);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.settings-save-bar .save-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle switch */
.form-switch-lg .form-check-input {
  width: 2.5em;
  height: 1.3em;
  cursor: pointer;
}
.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #F5F2F8;
}
.setting-row:last-child { border-bottom: none; }
.setting-row-info .setting-row-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.setting-row-info .setting-row-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.setting-row-control { flex-shrink: 0; min-width: 180px; text-align: right; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1199px) {
  .odoo-sidebar {
    transform: translateX(-100%);
    width: var(--osb-w) !important;
  }
  .odoo-sidebar.show { transform: translateX(0); }
  #page-content { margin-left: 0 !important; }
  .odoo-modtabs-inner { padding-left: 16px; }
  .osb-toggle { display: flex; }
}

@media (max-width: 767px) {
  .odoo-apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    padding: 16px 16px 32px;
  }
  .odoo-home-header { padding: 32px 16px 16px; }
  .odoo-home-title { font-size: 22px; }
  .odoo-settings-layout { flex-direction: column; }
  .odoo-settings-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
  .osn-nav-scroll { display: flex; flex-wrap: wrap; gap: 0; padding-bottom: 0; }
  .osn-group-label { display: none; }
  .osn-tab { width: auto; flex: 0 0 auto; border-left: none; border-bottom: 3px solid transparent; padding: 10px 16px; font-size: 13px; }
  .osn-tab.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .settings-pane-scroll { padding: 20px; }
  .settings-save-bar { padding: 10px 20px; }
}

/* ── Page header (module pages) ─────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.main-content { width: 100%; }
.product-tile .oos-overlay { position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,.6);display:flex;align-items:center;justify-content:center; }

/* Cart panel */
.pos-cart-panel {
  width: 340px;
  min-width: 320px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  border-radius: 0 var(--card-radius) var(--card-radius) 0;
}
.cart-header { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; background: #fff; font-weight: 600; font-size: 15px; }
.cart-items { flex: 1; overflow-y: auto; padding: 8px; }

/* Cart item row */
.cart-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; margin-bottom: 6px; }
.cart-item .ci-name { font-weight: 600; font-size: 13px; color: #1e293b; }
.cart-item .ci-price { font-size: 12px; color: #64748b; }
.ci-qty-ctrl { display: flex; align-items: center; gap: 6px; }
.ci-qty-ctrl button { width: 26px; height: 26px; border: 1px solid #cbd5e1; background: #fff; border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; }
.ci-qty-ctrl button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ci-qty-ctrl input { width: 40px; text-align: center; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px; padding: 2px; }
.ci-total { font-weight: 700; color: #1e293b; font-size: 14px; }
.ci-remove { color: #ef4444; background: none; border: none; cursor: pointer; font-size: 15px; }

/* Cart totals */
.cart-totals { padding: 12px 16px; border-top: 1px solid #e2e8f0; background: #fff; }
.totals-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.totals-row.grand { font-size: 17px; font-weight: 700; color: #1e293b; border-top: 2px solid #e2e8f0; padding-top: 8px; margin-top: 4px; }
.btn-checkout { width: 100%; padding: 12px; font-size: 16px; font-weight: 600; border-radius: 8px; }

/* ── Tables ─────────────────────────────────────────────── */
.table th { background: #f1f5f9; font-size: 13px; }
.table td { vertical-align: middle; font-size: 13px; }

/* ── Form helpers ────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; }
.required::after { content: ' *'; color: #ef4444; }

/* ── Receipt print styles ────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .receipt-wrapper { width: 80mm; margin: 0 auto; font-family: monospace; font-size: 12px; }
}

/* ── Page header ─────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h4 { margin: 0; font-weight: 700; color: #1e293b; }

/* ── Misc ────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.img-product-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #f1f5f9; }
.spinner-overlay { position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.35);z-index:9999;display:flex;align-items:center;justify-content:center; }
