:root {
  --bg: #F5F5FB;
  --card: #ffffff;
  --text: #15131F;
  --muted: #6b7280;
  --muted-2: #9b98ad;
  --border: #E9E7F2;
  --primary: #5A4FE0;
  --primary-dark: #4739C4;
  --primary-light: #EEECFC;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 20, 43, .05);
  --shadow-md: 0 6px 20px rgba(23, 20, 43, .07);
  --shadow-lg: 0 18px 40px rgba(23, 20, 43, .14);
  --sidebar-bg: #17142B;
  --sidebar-card: #211C3E;
  --sidebar-text: #FFFFFF;
  --sidebar-muted: #938FB0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--primary-light); color: var(--primary-dark); }

/* Slim custom scrollbar for a more polished feel */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d7e8; border-radius: 10px; border: 2px solid var(--bg); }
.sidebar::-webkit-scrollbar-thumb { background: #363057; border-color: var(--sidebar-bg); }

/* ---- App shell: sidebar (desktop) + content column ---- */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 252px;
  min-width: 252px;
  background: linear-gradient(185deg, #1B1733 0%, #14111F 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.sidebar-logo {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 12px rgba(90, 79, 224, .45);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand-text { color: var(--sidebar-text); font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.sidebar-brand-sub { color: var(--sidebar-muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; margin-top: 1px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--sidebar-muted) !important;
  text-decoration: none !important;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sidebar-nav .nav-icon { width: 18px; height: 18px; min-width: 18px; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(90, 79, 224, .35);
}
.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 16px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-user .user-name { color: var(--sidebar-text); font-size: 13px; font-weight: 600; }
.sidebar-user .role-badge { align-self: flex-start; }
.sidebar-user .logout-link { color: var(--sidebar-muted) !important; font-size: 12.5px; }
.sidebar-user .logout-link:hover { color: #fff !important; }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Top bar: hidden on desktop (sidebar covers brand/user/logout), shown on mobile */
.topbar {
  display: none;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}
.brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--text) !important;
  text-decoration: none !important;
  letter-spacing: -.01em;
}
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: var(--muted) !important;
  text-decoration: none !important;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--primary-light); color: var(--primary) !important; }

.user-menu { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.user-name { color: var(--muted); font-size: 13px; }
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 6px;
}
.role-admin { background: var(--primary-light); color: var(--primary); }
.role-staff { background: #e7f8ee; color: var(--green); }
.logout-link { color: var(--muted) !important; font-size: 13px; }
.sidebar-user .role-admin, .sidebar-user .role-staff { margin-left: 0; }

.page { max-width: 1180px; margin: 0 auto; padding: 30px 32px 64px; width: 100%; }

h1 { font-size: 23px; margin: 0 0 4px; font-weight: 800; letter-spacing: -.015em; }
h2 { font-size: 17px; margin: 0 0 14px; font-weight: 700; letter-spacing: -.01em; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

/* "Classy" uppercase eyebrow label — use above a section title for emphasis */
.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .15s ease;
}

.stat-card { position: relative; overflow: hidden; }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; position: relative; z-index: 1; }
.stat-icon {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
}
.stat-icon .nav-icon { width: 17px; height: 17px; }
.stat-green .stat-icon { background: #e7f8ee; color: var(--green); }
.stat-amber .stat-icon { background: #fdf1e0; color: var(--amber); }
.stat-red .stat-icon { background: #fde8e8; color: var(--red); }
.stat-card .stat-label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .stat-sub { color: var(--muted-2); font-size: 12px; margin-top: 4px; }
.stat-green .stat-value { color: var(--green); }
.stat-red .stat-value { color: var(--red); }
.stat-amber .stat-value { color: var(--amber); }
.stat-card::after {
  content: "";
  position: absolute;
  right: -18px; top: -18px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: var(--primary-light);
  opacity: .5;
  z-index: 0;
}
.stat-green.stat-card::after { background: #e7f8ee; }
.stat-red.stat-card::after { background: #fde8e8; }
.stat-amber.stat-card::after { background: #fdf1e0; }
.stat-card .stat-label, .stat-card .stat-value, .stat-card .stat-sub { position: relative; z-index: 1; }

.section { margin-bottom: 32px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; background: #FAFAFD; }
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #FAFAFD; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.low-stock { color: var(--red); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(90, 79, 224, .28);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(90, 79, 224, .34); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-secondary { background: #fff; color: var(--text) !important; border-color: var(--border); box-shadow: none; }
.btn-secondary:hover { background: var(--bg); transform: none; box-shadow: none; }
.btn-danger { background: #fff; color: var(--red) !important; border-color: #fca5a5; box-shadow: none; }
.btn-danger:hover { background: #fef2f2; transform: none; box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

input[type=text], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3.5px var(--primary-light); border-color: var(--primary); }
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; color: #374151; }
.field { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 140px; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; }
.flash-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ---- Sign-in: 50/50 split screen ---- */
body:has(.login-split) { margin: 0; }
body:has(.login-split) .page { max-width: none; margin: 0; padding: 0; width: 100%; min-height: 100vh; }

.login-split { min-height: 100vh; display: flex; width: 100%; }

.login-left {
  flex: 1 1 50%;
  background: linear-gradient(160deg, #171433 0%, #0F0D22 55%, #0B0918 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 79, 224, .35), transparent 70%);
  top: -120px; right: -140px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; position: relative; z-index: 1; }
.login-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff;
}
.login-brand-text { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.login-heading {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  max-width: 460px;
  position: relative; z-index: 1;
}
.login-lead {
  color: #B7B3D6;
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 0 34px;
  position: relative; z-index: 1;
}
.login-features { list-style: none; margin: 0 auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.login-features li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: #E6E4F5; font-weight: 500; }
.login-features .nav-icon {
  width: 20px; height: 20px; min-width: 20px;
  padding: 3px;
  border-radius: 50%;
  background: rgba(90, 79, 224, .35);
  color: #C9C4F0;
  stroke-width: 2.4;
}
.login-copyright { color: #74708F; font-size: 12px; margin: 56px 0 0; position: relative; z-index: 1; }

.login-right {
  flex: 1 1 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-form-wrap { width: 100%; max-width: 360px; }
.login-form-logo { display: none; font-weight: 800; color: var(--primary); }
.login-welcome { font-size: 25px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.015em; }
.login-subtitle { color: var(--muted); margin: 0 0 26px; font-size: 13.5px; }
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 8px;
  color: var(--muted-2); cursor: pointer;
}
.password-toggle:hover { background: var(--bg); color: var(--text); }
.password-toggle .nav-icon { width: 17px; height: 17px; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; font-size: 12.5px; }
.checkbox-field { display: flex; align-items: center; gap: 7px; font-weight: 500; color: var(--muted); cursor: pointer; }
.checkbox-field input { width: auto; }
.forgot-link { font-weight: 600; font-size: 12.5px; }
.forgot-note { background: var(--primary-light); color: var(--primary-dark); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin: 4px 0 14px; }
.login-submit { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 12px; }
.login-admin-note { text-align: center; color: var(--muted-2); font-size: 12.5px; margin: 22px 0 0; }

@media (max-width: 900px) {
  .login-left { display: none; }
  .login-right { padding: 32px 20px; min-height: 100vh; }
  .login-form-logo { display: block; text-align: center; font-size: 17px; margin-bottom: 22px; }
}

.badge-in { color: var(--green); font-weight: 600; }
.badge-out { color: var(--red); font-weight: 600; }

.actions-cell { display: flex; gap: 8px; }

.chart-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }

.tag { display: inline-block; background: #f1f5f9; color: #475569; padding: 2px 8px; border-radius: 6px; font-size: 12px; }

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

/* ---- Mobile: collapse sidebar, show top bar + bottom tab bar ---- */
.mobile-tabbar { display: none; }

@media (max-width: 900px) {
  /* Pages set a custom column ratio via inline style (e.g. "1.3fr 1fr") for
     their two/three-column layouts — those inline styles beat this class rule
     by specificity, so collapse them to a simpler 2-up flow at tablet width
     without needing !important or touching every page's markup. */
  .grid[style*="grid-template-columns"] { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important; }
}

@media (max-width: 640px) {
  .sidebar { display: none; }
  .topbar { display: block; }
  .topbar-inner { gap: 10px; }
  .user-menu { width: 100%; justify-content: space-between; margin-left: 0; }
  .page { padding: 20px 16px 92px; }
  .grid { grid-template-columns: 1fr !important; }
  .form-row { flex-direction: column; gap: 0; }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(10px);
    border-top: 1px solid var(--border);
    z-index: 20;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-tabbar a {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    color: var(--muted) !important;
    text-decoration: none !important;
    font-size: 10.5px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 10px;
  }
  .mobile-tabbar .nav-icon { width: 18px; height: 18px; }
  .mobile-tabbar a.active { color: var(--primary) !important; background: var(--primary-light); }
}

/* ---- Sample/demo data notice ---- */
.demo-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fffbeb, #fef8e4);
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.demo-notice strong { font-weight: 700; }

/* ---- POS / New Sale ---- */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pos-product {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.pos-product:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pos-product .pos-product-name { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.pos-product .pos-product-meta { color: var(--muted); font-size: 12px; }
.pos-product .pos-product-variants { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pos-product .pos-product-price { color: var(--primary); font-weight: 700; margin-top: 8px; font-size: 14px; }
.pos-cart { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 16px; box-shadow: var(--shadow-md); }
.pos-cart-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pos-cart-item:last-of-type { border-bottom: none; }
.pos-cart-item .pos-cart-item-name { font-weight: 600; }
.pos-cart-item .pos-cart-item-sub { color: var(--muted); font-size: 12px; }
.pos-cart-totals { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 13.5px; }
.pos-cart-totals div { display: flex; justify-content: space-between; margin-bottom: 6px; }
.pos-cart-totals .pos-grand-total { font-weight: 800; font-size: 17px; color: var(--text); margin-top: 8px; }
@media (max-width: 640px) {
  .pos-layout { grid-template-columns: 1fr; }
}

/* ---- Status pills (transfers, orders) ---- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.pill-pending { background: #fffbeb; color: #b45309; }
.pill-in-transit { background: #eff6ff; color: #1d4ed8; }
.pill-completed { background: #f0fdf4; color: #15803d; }
.pill-cancelled { background: #fef2f2; color: #b91c1c; }

/* ---- Customer tier badges ---- */
.tier-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.tier-gold { background: #fffbeb; color: #92400e; }
.tier-silver { background: #f1f5f9; color: #475569; }
.tier-bronze { background: #fff7ed; color: #9a3412; }

/* ---- Product variant chips (Designs & Stock) ---- */
.variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #DEDBF7;
}
.variant-chip .variant-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.variant-chip-muted { background: #F4F3FA; color: var(--muted); border-color: var(--border); }

/* ---- Report period tabs (Weekly / Monthly / Yearly) ---- */
.report-tabs { display: inline-flex; gap: 3px; background: #F0EFF8; padding: 4px; border-radius: 11px; margin-bottom: 22px; }
.report-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.report-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.report-panel { display: none; }
.report-panel.active { display: block; }

/* ================= Global toolbar (search + quick actions) ================= */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .7);
  backdrop-filter: saturate(180%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 9;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 240px;
  flex: 1;
  max-width: 360px;
  color: var(--muted-2);
}
.search-box .nav-icon { width: 16px; height: 16px; min-width: 16px; }
.search-box input {
  border: none;
  padding: 0;
  background: transparent;
  flex: 1;
  font-size: 13px;
}
.search-box input:focus { box-shadow: none; }
.search-box .icon-btn { color: var(--muted-2); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  color: inherit;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn .nav-icon { width: 15px; height: 15px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn .nav-icon { width: 15px; height: 15px; }
.btn-ghost {
  background: #fff;
  color: var(--text) !important;
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--bg); transform: none; box-shadow: none; }
.btn-dark {
  background: #15132A;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(21, 19, 42, .28);
}
.btn-dark:hover { background: #0E0C1D; box-shadow: 0 8px 18px rgba(21, 19, 42, .34); }

@media (max-width: 900px) {
  .page-toolbar { padding: 14px 16px; }
  .search-box { max-width: none; }
}
@media (max-width: 640px) {
  .page-toolbar { display: none; }
}

/* ================= Sidebar: low-stock alert + user profile ================= */
.sidebar-alert { margin: 0 4px; }
.sidebar-alert-label {
  display: block;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 6px;
}
.sidebar-alert-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(217, 119, 6, .16);
  color: #F5B057;
  border: 1px solid rgba(245, 176, 87, .25);
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
}
.sidebar-alert-pill .nav-icon { width: 14px; height: 14px; min-width: 14px; }

.sidebar-user { display: flex; align-items: center; gap: 9px; }
.avatar-circle {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user .logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 7px;
}
.sidebar-user .logout-link:hover { background: rgba(255, 255, 255, .08); }
.sidebar-user .logout-link .nav-icon { width: 14px; height: 14px; }

/* ================= Modal (Add Product) ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 30, .5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0 0 3px; }
.modal-subtitle { color: var(--muted); font-size: 12.5px; margin: 0; }
.modal .field label { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; justify-content: center; }
.modal-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; }

.pill-select { display: flex; flex-wrap: wrap; gap: 8px; }
.option-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.option-pill:hover { border-color: var(--primary); }
.option-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.option-pill-sm { padding: 7px 13px; min-width: 44px; text-align: center; }

.swatch-select { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 2px #fff;
}
.color-swatch.active { border-color: var(--primary); box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--primary-light); }

.sku-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 18px;
}
.sku-label { color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: block; }
.sku-value { font-weight: 800; font-size: 15px; letter-spacing: .02em; margin-left: auto; }
.sku-check { color: var(--green); display: flex; }
.sku-check .nav-icon { width: 16px; height: 16px; }

/* ================= Customers directory ================= */
.tier-tabs { display: inline-flex; gap: 3px; background: #F0EFF8; padding: 4px; border-radius: 11px; margin-bottom: 20px; }
.tier-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.tier-tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }

.customer-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.customer-row { cursor: pointer; }
.customer-row.selected { background: var(--primary-light); }
.customer-name-cell { display: flex; align-items: center; gap: 10px; }
.customer-name-cell .avatar-circle { width: 30px; height: 30px; font-size: 11px; }
.customer-name-cell .customer-phone { color: var(--muted); font-size: 12px; display: block; }

.customer-detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 18px; box-shadow: var(--shadow-sm); position: sticky; top: 84px; text-align: center; }
.customer-detail-empty-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted-2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.customer-detail-empty-icon .nav-icon { width: 20px; height: 20px; }
.customer-detail h3 { margin: 0 0 6px; font-size: 15px; }
.customer-detail p { color: var(--muted); font-size: 12.5px; margin: 0; line-height: 1.5; }
.customer-detail.filled { text-align: left; }
.customer-detail.filled .avatar-circle { width: 42px; height: 42px; font-size: 15px; margin-bottom: 10px; }
.customer-detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.customer-detail-row:last-child { border-bottom: none; }
.customer-detail-row span:first-child { color: var(--muted); }
.customer-detail-row span:last-child { font-weight: 600; }
@media (max-width: 900px) {
  .customer-layout { grid-template-columns: 1fr; }
  .customer-detail { position: static; }
}

/* ================= Dashboard: trend badges, alerts list, activity rows ================= */
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.stat-trend-up { color: var(--green); }
.stat-trend-down { color: var(--red); }
.stat-trend-sub { color: var(--muted-2); font-weight: 500; margin-left: 2px; }

.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row-title { font-weight: 600; font-size: 13.5px; }
.list-row-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-row-value { font-weight: 700; font-size: 13.5px; white-space: nowrap; }

.pill-out { background: #fef2f2; color: #b91c1c; }
.pill-low { background: #fffbeb; color: #b45309; }
.pill-refunded { background: #fef2f2; color: #b91c1c; }
