:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --sidebar: #f8f9fc;
  --ink: #1e2330;
  --muted: #8b93a7;
  --line: #e6e9f0;
  --accent: #5b6cff;
  --accent-soft: rgba(91, 108, 255, 0.12);
  --danger: #ea5455;
  --ok: #28c76f;
  --shadow: 0 2px 10px rgba(34, 41, 47, 0.06);
  --shadow-lg: 0 12px 28px rgba(34, 41, 47, 0.1);
  --radius: 12px;
  --sidebar-w: 268px;
  --topbar-h: 68px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
body > input[name="csrfmiddlewaretoken"] { display: none; }

.app-shell { min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.65rem 0 1.15rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand-logo { height: 34px; width: auto; }
.sidebar-close { display: none; }
.sidebar-nav {
  padding: 0.85rem 0.75rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.menu-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1rem 0.65rem 0.45rem;
}
.nav-link {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.58rem 0.72rem;
  border-radius: 10px;
  color: #4b5568;
  font-size: 0.9rem;
  margin-bottom: 0.12rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.nav-link i {
  font-size: 1.05rem;
  margin-top: 0.1rem;
  color: var(--accent);
  flex-shrink: 0;
}
.nav-link span { line-height: 1.35; }
.nav-link:hover {
  background: #eef1f8;
  color: var(--ink);
  text-decoration: none;
}
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 35;
  backdrop-filter: blur(2px);
}

/* Page */
.page-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s ease;
}
.app-shell.sidebar-collapsed .sidebar,
html.sidebar-pref-collapsed .app-shell .sidebar {
  transform: translateX(-105%);
}
.app-shell.sidebar-collapsed .page-wrap,
html.sidebar-pref-collapsed .app-shell .page-wrap {
  margin-left: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.35rem;
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-title-wrap { min-width: 0; }
.topbar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.icon-btn {
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}
.icon-btn:hover { background: #f0f2f7; }
.icon-btn.danger { color: var(--danger); }
.top-search {
  position: relative;
  display: flex;
  align-items: center;
}
.top-search i {
  position: absolute;
  left: 0.8rem;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}
.top-search input {
  width: min(300px, 38vw);
  border: 1px solid var(--line);
  background: #f7f8fb;
  border-radius: 10px;
  padding: 0.6rem 0.9rem 0.6rem 2.2rem;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.top-search input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cart-btn:hover {
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-1px);
}
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cart-badge.pulse {
  animation: pulse 0.4s ease;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.page-content {
  padding: 1.25rem 1.4rem 1.5rem;
  width: 100%;
  flex: 1;
}

.messages { list-style: none; padding: 0; margin: 0; }

/* Toast */
.toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: grid;
  gap: 0.55rem;
  width: min(360px, calc(100vw - 1.5rem));
  pointer-events: none;
}
.toast {
  background: #111827;
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 0.9rem;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #123524; border-left: 3px solid var(--ok); }
.toast-error { background: #3b1414; border-left: 3px solid var(--danger); }
.toast-warning { background: #3a2710; border-left: 3px solid #f59e0b; }

/* Hero */
.hero-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #dfe3ea;
  box-shadow: var(--shadow);
  margin-bottom: 1.35rem;
}
.hero-banner img {
  width: 100%;
  height: clamp(170px, 30vw, 300px);
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.4rem 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(12, 18, 32, 0.72));
  color: #fff;
}
.hero-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hero-overlay h2 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  letter-spacing: -0.02em;
}
.hero-overlay p:last-child {
  margin: 0;
  opacity: 0.9;
  font-size: 0.92rem;
}

.mobile-cats {
  display: none;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
  scrollbar-width: thin;
}
.mobile-cats a,
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.mobile-cats a:hover,
.chip:hover {
  background: var(--accent-soft);
  text-decoration: none;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.chip.active {
  background: var(--accent);
  color: #fff;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0 1rem;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.section-head a {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
}

.sort-bar { margin: 0; }
.sort-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.sort-label select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  color: var(--ink);
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.product-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.product-card.reveal {
  opacity: 0;
  transform: translateY(10px);
}
.product-card.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.18s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #d4daf5;
}
.product-card-link { display: block; color: inherit; flex: 1; }
.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #fbfcfe, #f4f6fa);
  display: grid;
  place-items: center;
  padding: 0.85rem;
  overflow: hidden;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s ease;
}
.product-card:hover .product-media img { transform: scale(1.04); }
.product-media-lg {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.badge-soldout,
.badge-featured {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-soldout { background: #111827; color: #fff; }
.badge-featured { background: var(--accent); color: #fff; }
.product-card.is-soldout { opacity: 0.72; }
.product-body { padding: 0.85rem 0.95rem 0.5rem; }
.product-cat,
.product-cat-link {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.3rem;
  display: inline-block;
}
.product-cat-link { color: var(--accent); margin-bottom: 0.45rem; }
.product-body h3,
.product-title {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.product-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.35em;
}
.product-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.price {
  font-weight: 700;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}
.price-lg { font-size: 1.5rem; margin-bottom: 0.85rem; }

.quick-add {
  margin: 0 0.85rem 0.85rem;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.quick-add:hover {
  background: var(--accent);
  color: #fff;
}
.quick-add.loading,
.btn.loading {
  opacity: 0.65;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 0.68rem 1.05rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { filter: brightness(0.96); text-decoration: none; color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); color: var(--accent); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
.btn-lg { padding: 0.8rem 1.15rem; font-size: 0.95rem; width: 100%; }

.detail-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
}
.form-stack { display: grid; gap: 0.9rem; }
.form-stack label { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 500; }
.form-stack input,
.form-stack textarea,
.form-stack select,
.search-hero-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #fff;
  width: 100%;
}
.form-stack input:focus,
.form-stack textarea:focus,
.form-stack select:focus,
.search-hero-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
table.data th,
table.data td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}
table.data th {
  background: #f8f9fc;
  font-weight: 600;
  color: #4b5568;
}
.cart-item {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
}
.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fafbfd;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cart-item strong {
  font-size: 0.84rem;
  text-transform: uppercase;
  line-height: 1.35;
}

.pagination {
  display: flex;
  gap: 0.45rem;
  margin-top: 1.35rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cart-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
.sticky-summary { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.cart-summary h3 { margin: 0 0 0.85rem; font-size: 1rem; }
.cart-summary dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem 1rem;
  margin: 0 0 1rem;
}
.cart-summary dt { color: var(--muted); }
.cart-summary dd { margin: 0; text-align: right; font-weight: 600; }
.total-label, .total-value {
  font-size: 1.05rem;
  color: var(--ink) !important;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--line);
}
.notice { color: var(--danger); font-size: 0.9rem; margin: 0.5rem 0 0.75rem; }
.meta { color: var(--muted); font-size: 0.88rem; }
.qty-row { display: flex; gap: 0.45rem; align-items: center; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.stepper button {
  width: 38px;
  height: 38px;
  border: 0;
  background: #f7f8fb;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink);
}
.stepper button:hover { background: #eef1f7; }
.stepper input {
  width: 52px;
  border: 0;
  text-align: center;
  padding: 0.4rem 0;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-sm button { width: 30px; height: 30px; font-size: 0.95rem; }
.stepper-sm input { width: 40px; }

.qr-box {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.qr-box img { margin: 1rem auto; max-width: 240px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--accent); }

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.gallery-thumb {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.3rem;
  background: #fff;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.buy-panel { display: grid; gap: 0.85rem; align-content: start; }
.buy-form { display: grid; gap: 0.75rem; }
.stock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.stock.in-stock { color: var(--ok); }
.stock.out-stock { color: var(--danger); }
.product-desc {
  color: #4b5568;
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}
.help-box {
  margin-top: 0.35rem;
  padding: 0.9rem;
  border-radius: 10px;
  background: #f7f8fb;
  border: 1px dashed var(--line);
}
.help-box p { margin: 0; }
.help-box .meta { margin-top: 0.25rem; }
.help-box a { color: var(--accent); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty-state i {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.65rem;
  display: inline-block;
}
.empty-state h3 { margin: 0 0 0.35rem; }
.empty-state p { margin: 0 0 1rem; color: var(--muted); }

.search-hero { margin-bottom: 1.15rem; }
.search-hero-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
}
.search-hero-form i { color: var(--muted); font-size: 1.2rem; }

.progress-wrap {
  height: 6px;
  background: #eef1f7;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b97ff);
  max-width: 100%;
}

.checkout-steps {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
  font-size: 0.88rem;
}
.checkout-steps span {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}
.checkout-steps .active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}
.checkout-steps .done { color: var(--ok); }
.order-lines {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.55rem;
}
.order-lines li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: #4b5568;
}

.site-footer-bar {
  border-top: 1px solid var(--line);
  padding: 1rem 1.4rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
  background: transparent;
}
body.has-mobile-cta .site-footer-bar {
  padding-bottom: 8.5rem;
}
.footer-phones {
  display: flex;
  gap: 0.85rem;
}
.footer-phones a { color: var(--accent); font-weight: 600; }

.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 50;
  height: 64px;
  background: rgba(28, 45, 65, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  padding: 0 0.25rem;
}
.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: rgba(255,255,255,0.72);
  font-size: 0.68rem;
  text-decoration: none;
  border-radius: 14px;
  min-height: 54px;
}
.mobile-bottom-nav a i { font-size: 1.2rem; }
.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
  color: #fff;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
}
.mobile-cart-icon {
  position: relative;
  display: inline-flex;
}
.mobile-cart-icon .cart-badge {
  top: -8px;
  right: -10px;
}

.mobile-sticky-cta {
  display: none;
}

/* Dashboard ERP */
.dash-erp {
  background: #f5f6fa;
}
.dash-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  background: #f5f6fa;
}
.dash-side {
  background: #ffffff;
  color: #4b5568;
  padding: 1rem 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #e6e9f0;
}
.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.7rem 1rem;
  border-bottom: 1px solid #eef0f5;
}
.dash-brand img { height: 32px; }
.dash-side .dash-nav-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #9aa3b5;
  margin: 0.95rem 0.7rem 0.35rem;
  font-weight: 700;
}
.dash-side a {
  color: #5b6475;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 0.12rem;
  font-size: 0.92rem;
}
.dash-side a i { font-size: 1.05rem; color: #8b93a7; }
.dash-side a:hover {
  color: #1e2330;
  background: #f3f5f9;
}
.dash-side a.active {
  color: #5b6cff;
  background: rgba(91, 108, 255, 0.1);
  font-weight: 600;
}
.dash-side a.active i { color: #5b6cff; }
.dash-main-wrap { min-width: 0; display: flex; flex-direction: column; }
.dash-topbar {
  background: #fff;
  border-bottom: 1px solid #e6e9f0;
  padding: 0.85rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.dash-topbar h1 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #8b93a7;
  font-size: 0.88rem;
}
.dash-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(91, 108, 255, 0.12);
  color: #5b6cff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.dash-main { padding: 1.15rem 1.35rem 2rem; }
.dash-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.dash-top h1 { margin: 0; letter-spacing: -0.02em; font-size: 1.25rem; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.stat {
  border: 1px solid #e6e9f0;
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.05rem;
  box-shadow: 0 2px 8px rgba(34, 41, 47, 0.04);
}
.stat .label { color: #8b93a7; font-size: 0.82rem; margin-bottom: 0.35rem; }
.stat .value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .value.money { font-size: 1.05rem; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}
.toolbar input,
.toolbar select {
  border: 1px solid #e6e9f0;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: #fff;
}
.dash-panel,
.erp-card {
  background: #fff;
  border: 1px solid #e6e9f0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(34, 41, 47, 0.04);
  overflow: hidden;
}
.dash-panel .data { border: 0; }
.form-hint {
  color: #8b93a7;
  font-size: 0.82rem;
  font-weight: 500;
}
.btn-warning-soft {
  background: #fff6e8;
  border-color: #f0c27a;
  color: #9a6700;
}
.btn-warning-soft:hover {
  background: #ffefd4;
  color: #9a6700;
}
.erp-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.erp-page-head h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.erp-breadcrumb {
  margin-top: 0.25rem;
  color: #8b93a7;
  font-size: 0.84rem;
}
.erp-breadcrumb a { color: #5b6cff; }
.erp-breadcrumb span { margin: 0 0.25rem; }
.erp-card-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.1rem;
  border-bottom: 1px dotted #d9dee8;
  background: #fcfcfd;
}
.erp-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
  min-width: 240px;
}
.erp-search-form input[type="search"] {
  flex: 1;
  min-width: 180px;
  border: 1px solid #e6e9f0;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}
.erp-search-form select {
  border: 1px solid #e6e9f0;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #fff;
}
.erp-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.erp-count {
  color: #5b6475;
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 0.35rem;
}
.erp-table {
  border: 0 !important;
  font-size: 0.9rem;
}
.erp-table th,
.erp-table td {
  border-bottom: 1px dotted #d9dee8 !important;
  vertical-align: middle !important;
  padding: 0.75rem 0.9rem !important;
}
.erp-table thead th {
  background: #f8f9fc !important;
  color: #5b6475;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.erp-table .num,
.erp-table .money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}
.erp-table .money {
  font-weight: 700;
}
.erp-table .col-id { width: 56px; color: #8b93a7; }
.erp-table .col-actions { width: 96px; text-align: right; }

/* Odoo-like dense striped table */
.odoo-table {
  font-size: 0.78rem !important;
  width: 100%;
  border-collapse: collapse !important;
}
.odoo-table thead th {
  background: #f0f2f5 !important;
  color: #4c4c4c !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border-bottom: 1px solid #d8dadd !important;
  border-top: 1px solid #d8dadd !important;
  padding: 0.45rem 0.55rem !important;
  white-space: nowrap;
}
.odoo-table td {
  padding: 0.4rem 0.55rem !important;
  border-bottom: 1px solid #ebebeb !important;
  vertical-align: top !important;
  color: #212529;
  line-height: 1.35;
}
.odoo-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}
.odoo-table tbody tr:hover {
  background: #eef5ff !important;
}
.odoo-table .erp-product-name {
  font-size: 0.78rem;
  font-weight: 700;
}
.odoo-table .money {
  font-size: 0.78rem;
  font-weight: 700;
}
.odoo-cell-title {
  font-weight: 600;
  color: #212529;
}
.odoo-cell-sub {
  color: #6c757d;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}
.odoo-line-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  max-width: 320px;
}
.odoo-line-list li {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
}
.odoo-line-name {
  color: #212529;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.odoo-line-qty {
  color: #6c757d;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.odoo-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.odoo-badge.badge-success {
  background: #d1e7dd;
  color: #0f5132;
  border-color: #badbcc;
}
.odoo-badge.badge-warning {
  background: #fff3cd;
  color: #664d03;
  border-color: #ffecb5;
}
.odoo-badge.badge-info {
  background: #cff4fc;
  color: #055160;
  border-color: #b6effb;
}
.odoo-badge.badge-danger {
  background: #f8d7da;
  color: #842029;
  border-color: #f5c2c7;
}
.odoo-badge.badge-muted {
  background: #e9ecef;
  color: #495057;
  border-color: #dee2e6;
}
.odoo-sub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 360px;
}
.btn-edit-soft {
  background: #fff4e5;
  border-color: #ffd8a8;
  color: #9a5b00;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
}
.btn-edit-soft:hover {
  background: #ffe8cc;
  color: #9a5b00;
}
.btn-delete-soft {
  background: #fde8ea;
  border-color: #f5c2c7;
  color: #842029;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
}
.btn-delete-soft:hover {
  background: #f8d7da;
  color: #842029;
}
.erp-inline-add {
  display: flex;
  gap: 0.45rem;
}
.erp-inline-add input {
  flex: 1;
  border: 1px solid #e6e9f0;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}
.odoo-table .erp-actions {
  gap: 0.35rem;
  flex-wrap: wrap;
}
.erp-product-cell {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.erp-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid #e6e9f0;
  background: #fafbfd;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.erp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.erp-thumb-lg {
  margin-top: 0.5rem;
  width: 120px;
  height: 120px;
  border: 1px solid #e6e9f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fafbfd;
}
.erp-thumb-lg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.erp-product-name {
  color: #5b6cff;
  font-weight: 650;
}
.erp-product-name:hover { text-decoration: underline; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.ok {
  background: #e8f8ef;
  color: #1a7f37;
}
.status-pill.off {
  background: #fdecec;
  color: #b42318;
}
.erp-actions {
  display: inline-flex;
  gap: 0.25rem;
  justify-content: flex-end;
}
.icon-action {
  width: 34px;
  height: 34px;
  border: 1px solid #e6e9f0;
  background: #f8f9fc;
  color: #5b6475;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.icon-action:hover {
  border-color: #5b6cff;
  color: #5b6cff;
  background: #eef1ff;
}
.icon-action.danger:hover {
  border-color: #ea5455;
  color: #ea5455;
  background: #fff1f1;
}
.inline-form { display: inline; margin: 0; }
.erp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
}
.erp-gallery-item {
  border: 1px solid #e6e9f0;
  border-radius: 10px;
  padding: 0.5rem;
  display: grid;
  gap: 0.45rem;
  background: #fafbfd;
}
.erp-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}
.erp-form-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(160deg, #f3f4f8, #e8ecf8);
}
.login-card {
  width: min(400px, 100%);
  border: 1px solid #e6e9f0;
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 12px 28px rgba(34, 41, 47, 0.08);
}
.login-card .brand-logo { height: 36px; margin-bottom: 1rem; }

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-105%);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.18);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-overlay { display: block; }
  .app-shell.sidebar-collapsed .sidebar { transform: translateX(-105%); }
  .app-shell.sidebar-collapsed.sidebar-open .sidebar { transform: translateX(0); }
  html.sidebar-pref-collapsed .app-shell .sidebar { transform: translateX(-105%); }
  html.sidebar-pref-collapsed .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  html.sidebar-pref-collapsed .app-shell .page-wrap,
  .app-shell.sidebar-collapsed .page-wrap,
  .page-wrap { margin-left: 0; }
  .sidebar-close { display: inline-flex; }
  .mobile-cats { display: flex; }
  .mobile-bottom-nav { display: flex; }
  .detail-layout { grid-template-columns: 1fr; }
  .sticky-summary { position: static; }
  .site-footer-bar { padding-bottom: 6.5rem; }
  .page-content { padding-bottom: 1rem; }
  .mobile-sticky-cta {
    display: block;
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + 64px + 0.55rem);
    z-index: 45;
  }
  .mobile-sticky-cta .btn {
    width: 100%;
    box-shadow: 0 10px 24px rgba(91, 108, 255, 0.35);
  }
  .cart-summary .desktop-cta { display: none; }
  .dash-body { grid-template-columns: 1fr; }
  .dash-side {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
  }
  .dash-brand { width: 100%; margin-bottom: 0.35rem; padding-bottom: 0.65rem; }
  .dash-side .dash-nav-label { display: none; }
}

@media (max-width: 640px) {
  .page-content { padding: 0.9rem 0.85rem 1rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
  .product-body { padding: 0.65rem 0.65rem 0.3rem; }
  .product-body h3 { font-size: 0.72rem; min-height: 2.5em; }
  .price { font-size: 0.84rem; }
  .quick-add {
    margin: 0 0.55rem 0.6rem;
    padding: 0.5rem;
    min-height: 40px;
  }
  .quick-add span { display: none; }
  .top-search { display: none; }
  .topbar-sub { display: none; }
  .hero-overlay { padding: 1rem; }
  .search-hero-form { grid-template-columns: auto 1fr; }
  .search-hero-form .btn { grid-column: 1 / -1; }
  .toast-host {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    top: auto;
    bottom: calc(0.75rem + 64px + 0.75rem);
  }
  .cart-mobile-list { display: grid; gap: 0.75rem; }
  .cart-mobile-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.85rem;
    display: grid;
    gap: 0.75rem;
  }
  .cart-desktop-table { display: none; }
  .cart-item strong { font-size: 0.78rem; }
}

@media (min-width: 641px) {
  .cart-mobile-list { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
