/* ============================================================
   iPRO Solutions POS - Global Design System
   Brand: Dominant Blue | Gold Accent | Grey Stripes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Sora:wght@400;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  /* Brand Blues */
  --blue-950: #020B1A;
  --blue-900: #051530;
  --blue-800: #0A2558;
  --blue-700: #0D3080;
  --blue-600: #1145B0;
  --blue-500: #1A5FD4;
  --blue-400: #3B7EE8;
  --blue-300: #6FA3F0;
  --blue-200: #A8C8F8;
  --blue-100: #D6E8FF;
  --blue-50:  #EEF5FF;

  /* Gold Accents */
  --gold-700: #7A5000;
  --gold-600: #A56B00;
  --gold-500: #D4920A;
  --gold-400: #E8AE2A;
  --gold-300: #F5C842;
  --gold-200: #FAE19A;
  --gold-100: #FEF6DC;

  /* Grey Stripes */
  --grey-900: #111827;
  --grey-800: #1F2937;
  --grey-700: #374151;
  --grey-600: #4B5563;
  --grey-500: #6B7280;
  --grey-400: #9CA3AF;
  --grey-300: #D1D5DB;
  --grey-200: #E5E7EB;
  --grey-100: #F3F4F6;
  --grey-50:  #F9FAFB;

  /* Semantic */
  --success: #059669;
  --success-light: #D1FAE5;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --info: #0891B2;
  --info-light: #CFFAFE;

  /* Typography */
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(1,21,80,0.08), 0 1px 2px rgba(1,21,80,0.04);
  --shadow: 0 4px 16px rgba(1,21,80,0.10), 0 2px 6px rgba(1,21,80,0.06);
  --shadow-lg: 0 8px 32px rgba(1,21,80,0.14), 0 4px 12px rgba(1,21,80,0.08);
  --shadow-xl: 0 16px 48px rgba(1,21,80,0.18), 0 8px 20px rgba(1,21,80,0.10);
  --shadow-gold: 0 4px 20px rgba(212,146,10,0.25);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--grey-900); background: var(--grey-50); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Global select normalisation ───────────────────────────────────────────
   1. Strip OS chrome from every single-value select.
   2. Give bare selects (no .form-control) the same visual style as inputs.
   3. Fix padding-right on .form-control selects so the arrow has room.
   4. Restore multi-select to browser default (no arrow needed).
────────────────────────────────────────────────────────────────────────── */
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: #fff;
}
/* Bare selects — apply the same visual style as .form-control inputs */
select:not(.form-control):not([multiple]) {
  padding: 8px 32px 8px 11px;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--grey-800);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
select:not(.form-control):not([multiple]):hover  { border-color: var(--grey-400); }
select:not(.form-control):not([multiple]):focus  {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(26,95,212,.10);
}
/* .form-control selects — inherit all form-control styles, just add arrow room */
select.form-control:not([multiple]) { padding-right: 34px; }
/* Multi-select — keep browser default behaviour */
select[multiple] {
  appearance: auto;
  -webkit-appearance: auto;
  background-image: none;
  cursor: default;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--grey-100); }
::-webkit-scrollbar-thumb { background: var(--blue-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-500); }

/* ============================================================
   LAYOUT - SIDEBAR + MAIN
   ============================================================ */

.ipro-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(170deg, var(--blue-950) 0%, var(--blue-900) 40%, var(--blue-800) 100%);
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
  height: 100vh;
  overflow: hidden;
}

/* Diagonal gold stripe accent on sidebar */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-500) 40%, transparent 100%);
  opacity: 0.7;
  pointer-events: none;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--blue-900);
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
  letter-spacing: -0.5px;
}

.sidebar-brand-text { flex: 1; }
.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.3px;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--gold-300);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-shop-badge {
  margin: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-shop-badge .shop-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.sidebar-shop-badge .shop-info { flex: 1; min-width: 0; }
.sidebar-shop-badge .shop-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-shop-badge .shop-type { font-size: 10px; color: var(--blue-300); text-transform: uppercase; letter-spacing: 0.8px; }

.sidebar-nav { flex: 1; min-height: 0; padding: 8px 0; overflow-y: auto; }

.nav-section-label {
  padding: 12px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 20px;
  margin: 2px 6px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  min-height: 44px;
  transition: all 0.18s ease;
  cursor: pointer;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(232,174,42,0.18) 0%, rgba(232,174,42,0.06) 100%);
  color: var(--gold-300);
  border: 1px solid rgba(232,174,42,0.20);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--gold-300);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.18s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.10); }
.sidebar-user .user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--blue-900);
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 10px; color: var(--blue-300); }
.sidebar-user .logout-btn { font-size: 14px; color: rgba(255,255,255,0.4); padding: 4px; border-radius: 4px; }
.sidebar-user .logout-btn:hover { color: var(--danger); background: rgba(220,38,38,0.1); }

/* ── Main Content ── */
.main-content,
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 var(--grey-200), 0 2px 8px rgba(1,21,80,0.04);
}

/* Gold stripe under topbar */
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--gold-400) 0%, var(--blue-500) 40%, transparent 100%);
  opacity: 0.5;
}

.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb .page-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--blue-900);
  line-height: 1.2;
}
.topbar-breadcrumb .page-sub {
  font-size: 12px;
  color: var(--grey-500);
}

.topbar-search {
  display: flex;
  align-items: center;
  background: var(--grey-50);
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 0 12px;
  gap: 8px;
  width: 280px;
  transition: all 0.18s;
}
.topbar-search:focus-within {
  border-color: var(--blue-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,95,212,0.08);
}
.topbar-search input {
  border: none; background: transparent;
  font-size: 13px; color: var(--grey-800);
  padding: 9px 0; flex: 1; outline: none;
}
.topbar-search .search-icon { color: var(--grey-400); font-size: 15px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-600);
  font-size: 16px;
  transition: all 0.18s;
  position: relative;
}
.topbar-btn:hover { border-color: var(--blue-300); color: var(--blue-600); background: var(--blue-50); }
.topbar-btn .badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 9px; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── Page Content ── */
.page-content {
  padding: 24px;
  flex: 1;
}

/* ============================================================
   STRIPE PATTERN ELEMENTS
   ============================================================ */

.stripe-divider {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--blue-600) 0px, var(--blue-600) 20px,
    var(--gold-400) 20px, var(--gold-400) 24px,
    var(--grey-300) 24px, var(--grey-300) 30px,
    transparent 30px, transparent 36px
  );
  border-radius: 2px;
  margin: 20px 0;
}

.stripe-header {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-900) 100%);
  position: relative;
  overflow: hidden;
}
.stripe-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-300) 0%, var(--gold-500) 50%, var(--gold-300) 100%);
}
.stripe-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.1) 0px, rgba(255,255,255,0.1) 6px,
    transparent 6px, transparent 10px
  );
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--grey-100);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-900);
  flex: 1;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  background: var(--grey-50);
  border-top: 1px solid var(--grey-100);
}

/* Stat Cards */
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.blue::before { background: linear-gradient(90deg, var(--blue-500), var(--blue-300)); }
.stat-card.gold::before { background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), #34D399); }
.stat-card.red::before { background: linear-gradient(90deg, var(--danger), #F87171); }

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.stat-card.blue .stat-icon { background: var(--blue-50); color: var(--blue-600); }
.stat-card.gold .stat-icon { background: var(--gold-100); color: var(--gold-600); }
.stat-card.green .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.red .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--blue-900);
  letter-spacing: -1px;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-500);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-card .stat-change {
  position: absolute;
  top: 18px; right: 18px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.stat-card .stat-change.up { background: var(--success-light); color: var(--success); }
.stat-card .stat-change.down { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead tr {
  background: linear-gradient(90deg, var(--blue-900) 0%, var(--blue-800) 100%);
}
.data-table thead th {
  padding: 13px 16px;
  text-align: left;
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Gold stripe on table header bottom */
.data-table thead tr::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-400), transparent);
}
.data-table tbody tr {
  border-bottom: 1px solid var(--grey-100);
  transition: background 0.12s;
}
.data-table tbody tr:hover { background: var(--blue-50); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 12px 16px; color: var(--grey-700); vertical-align: middle; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.18s;
  border: 1.5px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #fff;
  border-color: var(--blue-700);
  box-shadow: 0 2px 8px rgba(17,69,176,0.25);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--blue-700), var(--blue-800)); box-shadow: 0 4px 16px rgba(17,69,176,0.35); transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--blue-900);
  border-color: var(--gold-500);
  box-shadow: 0 2px 8px rgba(212,146,10,0.25);
}
.btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); box-shadow: var(--shadow-gold); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--blue-600);
  border-color: var(--blue-300);
}
.btn-outline:hover:not(:disabled) { background: var(--blue-50); border-color: var(--blue-500); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-700);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--grey-800);
  background: #fff;
  transition: all 0.18s;
  outline: none;
}
.form-control:focus {
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(26,95,212,0.10);
}
.form-control::placeholder { color: var(--grey-400); }
.form-control:disabled { background: var(--grey-50); color: var(--grey-500); cursor: not-allowed; }

.form-select {
  /* appearance:none + chevron now handled globally — this just ensures padding-right */
  padding-right: 36px;
}

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .input-addon {
  padding: 0 14px;
  background: var(--grey-100);
  border: 1.5px solid var(--grey-300);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  display: flex; align-items: center;
  font-size: 13px; color: var(--grey-600);
  white-space: nowrap;
}

.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue-600); cursor: pointer; }
.form-check-label { font-size: 13px; color: var(--grey-700); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-blue { background: var(--blue-100); color: var(--blue-700); }
.badge-gold { background: var(--gold-100); color: var(--gold-700); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-grey { background: var(--grey-100); color: var(--grey-600); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge::before { content: '●'; font-size: 8px; }

/* ============================================================
   POS TERMINAL
   ============================================================ */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.pos-products-panel {
  background: var(--grey-50);
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--grey-200);
}

.pos-cart-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--grey-200);
}

.pos-search-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--blue-300);
  border-radius: var(--radius-lg);
  padding: 0 14px;
  gap: 10px;
  margin-bottom: 16px;
  box-shadow: 0 0 0 4px rgba(26,95,212,0.06);
}
.pos-search-bar input {
  flex: 1; border: none; background: transparent;
  padding: 12px 0; font-size: 15px; outline: none; color: var(--grey-800);
  font-weight: 500;
}
.pos-search-bar .search-icon { color: var(--blue-500); font-size: 18px; }

.pos-categories {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.pos-cat-btn {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--grey-200);
  background: #fff;
  color: var(--grey-600);
  transition: all 0.18s;
  cursor: pointer;
}
.pos-cat-btn:hover, .pos-cat-btn.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(17,69,176,0.25);
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.product-card {
  background: #fff;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.product-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.product-card.out-of-stock { opacity: 0.55; cursor: not-allowed; }
.product-card.out-of-stock::after {
  content: 'OUT OF STOCK';
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-15deg);
  background: rgba(220,38,38,0.85);
  color: #fff; font-size: 9px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 4px;
}
.product-card .product-img {
  width: 100%; aspect-ratio: 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--grey-100);
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.product-card .product-name { font-size: 12px; font-weight: 600; color: var(--grey-800); line-height: 1.3; margin-bottom: 4px; }
.product-card .product-price { font-size: 14px; font-weight: 800; color: var(--blue-700); font-family: var(--font-display); }
.product-card .product-stock { font-size: 10px; color: var(--grey-400); }
.product-card .low-stock { color: var(--warning); }

/* ── Cart ── */
.cart-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--grey-100);
  background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
}
.cart-header-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.cart-customer-select {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 8px;
  cursor: pointer;
  transition: background 0.18s;
}
.cart-customer-select:hover { background: rgba(255,255,255,0.13); }
.cart-customer-select .icon { color: var(--gold-300); font-size: 14px; }
.cart-customer-select span { font-size: 12px; color: rgba(255,255,255,0.75); flex: 1; }
.cart-customer-select .change { font-size: 10px; color: var(--gold-300); font-weight: 600; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.cart-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid var(--grey-50);
  transition: background 0.12s;
}
.cart-item:hover { background: var(--blue-50); }
.cart-item-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--grey-800); }
.cart-item-price { font-size: 12px; color: var(--grey-500); }
.cart-item-controls {
  display: flex; align-items: center; gap: 6px;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--grey-100);
  border: 1px solid var(--grey-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--grey-700);
  cursor: pointer; transition: all 0.15s;
}
.qty-btn:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.qty-display { font-size: 14px; font-weight: 700; color: var(--blue-700); min-width: 28px; text-align: center; }
.cart-item-total { font-size: 14px; font-weight: 700; color: var(--blue-800); min-width: 70px; text-align: right; }
.remove-item { color: var(--grey-300); font-size: 14px; cursor: pointer; padding: 2px; border-radius: 4px; }
.remove-item:hover { color: var(--danger); background: var(--danger-light); }

.cart-summary {
  padding: 14px 18px;
  background: var(--grey-50);
  border-top: 1px solid var(--grey-200);
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--grey-600);
  padding: 3px 0;
}
.summary-row.total {
  font-size: 18px; font-weight: 800;
  color: var(--blue-900); font-family: var(--font-display);
  padding-top: 8px; margin-top: 4px;
  border-top: 2px solid var(--grey-200);
}
.summary-row.total .total-amount { color: var(--blue-700); }

.cart-actions { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.btn-checkout {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--blue-900);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-gold);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-checkout:hover { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(212,146,10,0.40); }

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(2,11,26,0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.94) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--grey-100);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--blue-900), var(--blue-800));
  position: relative;
}
.modal-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-300), transparent);
}
.modal-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #fff; flex: 1; }
.modal-close { width: 30px; height: 30px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s; }
.modal-close:hover { background: rgba(220,38,38,0.3); color: #fff; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--grey-100); display: flex; gap: 10px; justify-content: flex-end; background: var(--grey-50); }

/* Modal sizes */
.modal.modal-lg { max-width: 780px; }
.modal.modal-xl { max-width: 1000px; }
.modal.modal-sm { max-width: 400px; }

/* ============================================================
   ALERTS & TOASTS
   ============================================================ */

.toast-container {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xl);
  border-left: 4px solid;
  min-width: 300px; max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--blue-500); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--blue-500); }
.toast-content { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--grey-900); }
.toast-msg { font-size: 12px; color: var(--grey-500); margin-top: 2px; }

/* ============================================================
   DASHBOARD CHARTS AREA
   ============================================================ */

.chart-container {
  position: relative;
  width: 100%;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  background: #fff;
  border: 1.5px solid var(--grey-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
}
.quick-action-btn:hover { border-color: var(--blue-400); background: var(--blue-50); transform: translateY(-3px); box-shadow: var(--shadow); }
.quick-action-btn .qa-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.quick-action-btn .qa-label { font-size: 12px; font-weight: 600; color: var(--grey-700); text-align: center; }

/* ============================================================
   BARCODE / QR DISPLAY
   ============================================================ */

.barcode-display {
  text-align: center;
  padding: 20px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
}
.barcode-display img { max-width: 100%; margin: 0 auto; }
.barcode-code { font-family: monospace; font-size: 14px; letter-spacing: 2px; color: var(--grey-700); margin-top: 8px; }

/* ============================================================
   RECEIPT
   ============================================================ */

.receipt {
  width: 280px;
  background: #fff;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 16px;
  line-height: 1.8;
}
.receipt-logo { text-align: center; font-weight: bold; font-size: 16px; }
.receipt-divider { border: none; border-top: 1px dashed #999; margin: 8px 0; }
.receipt-row { display: flex; justify-content: space-between; }
.receipt-total { font-weight: bold; font-size: 14px; }

/* ============================================================
   LOADING STATES
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-200) 50%, var(--grey-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--grey-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey-200);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--grey-600);
  cursor: pointer; transition: all 0.15s;
}
.page-btn:hover { border-color: var(--blue-400); color: var(--blue-600); background: var(--blue-50); }
.page-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   RESPONSIVE  –  1200 / 1024 / 768 / 480
   ============================================================ */

/* ── Sidebar overlay backdrop ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(1,21,80,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
}
.sidebar-overlay.show { display: block; }

/* ── Hamburger toggle (hidden on large screens) ───────────── */
.sidebar-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey-200);
  background: #fff;
  align-items: center; justify-content: center;
  color: var(--blue-700);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover { background: var(--blue-50); border-color: var(--blue-300); }

/* ── 1200px — wide tablet / narrow desktop ────────────────── */
@media (max-width: 1200px) {
  .stats-grid    { grid-template-columns: repeat(4, 1fr) !important; }
  .summary-strip { grid-template-columns: repeat(4, 1fr) !important; }
  .kpi-strip     { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ── 1024px — tablet landscape ───────────────────────────── */
@media (max-width: 1024px) {
  /* Sidebar slides off-canvas */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    z-index: 100;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-content, .main-wrap { margin-left: 0; }
  /* Show hamburger */
  .sidebar-toggle { display: flex; }
  /* POS collapses to stacked panels */
  .pos-layout { grid-template-columns: 1fr; }
  /* Grids */
  .quick-actions  { grid-template-columns: repeat(2, 1fr); }
  .stats-grid     { grid-template-columns: repeat(3, 1fr) !important; }
  .summary-strip  { grid-template-columns: repeat(3, 1fr) !important; }
  .kpi-strip      { grid-template-columns: repeat(3, 1fr) !important; }
  /* Dashboard chart rows */
  .dash-charts  { grid-template-columns: 1fr !important; }
  .dash-bottom  { grid-template-columns: 1fr 1fr !important; }
  /* Modals */
  .modal.modal-xl { max-width: 96vw; }
  .modal.modal-lg { max-width: 93vw; }
}

/* ── 768px — tablet portrait / large phone ────────────────── */
@media (max-width: 768px) {
  /* Topbar */
  .topbar { padding: 0 14px; gap: 10px; height: 58px; }
  .topbar-search { display: none; }
  .topbar-breadcrumb .page-sub { display: none; }
  .topbar-btn  { width: 34px; height: 34px; font-size: 14px; }

  /* Layout */
  .page-content { padding: 12px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }

  /* Stat cards */
  .stats-grid  { grid-template-columns: repeat(2, 1fr) !important; }
  .summary-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-strip   { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card   { padding: 14px 12px; }
  .stat-card .stat-value { font-size: 22px; }

  /* Dashboard chart rows */
  .dash-charts { grid-template-columns: 1fr !important; }
  .dash-bottom { grid-template-columns: 1fr !important; }

  /* Modals — sheet style (slides up from bottom) */
  .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
  .modal {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    max-height: 92vh;
  }
  .modal-body { max-height: 65vh; overflow-y: auto; }

  /* Tables */
  .data-table th,
  .data-table td { padding: 9px 8px; font-size: 12px; }

  /* Buttons */
  .btn { font-size: 13px; padding: 8px 14px; }

  /* Toasts */
  .toast { min-width: 240px; max-width: calc(100vw - 24px); }
  .toast-container { right: 12px; top: 68px; }
}

/* ── 480px — phone portrait ───────────────────────────────── */
@media (max-width: 480px) {
  /* Topbar tighter */
  .topbar { height: 52px; padding: 0 10px; }
  .topbar-breadcrumb .page-title { font-size: 14px; }
  .topbar-actions { gap: 4px; }
  .topbar-btn { width: 32px; height: 32px; font-size: 13px; }

  /* Content */
  .page-content { padding: 8px; }

  /* Stat cards single column when very narrow */
  .stats-grid  { grid-template-columns: repeat(2, 1fr) !important; }
  .summary-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi-strip   { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card   { padding: 12px 10px; }
  .stat-card .stat-value { font-size: 18px; }
  .stat-card .stat-label { font-size: 10px; }
  .stat-card .stat-icon  { width: 36px; height: 36px; font-size: 16px; }

  /* Dashboard rows single-column */
  .dash-charts { grid-template-columns: 1fr !important; }
  .dash-bottom { grid-template-columns: 1fr !important; }

  /* Cards */
  .card { padding: 14px; }

  /* Modals */
  .modal-body  { padding: 14px; }
  .modal-footer { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1; justify-content: center; min-width: 110px; }
  /* Stack all grid columns inside modal bodies */
  .modal-body [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* Table */
  .table-container { border-radius: var(--radius-sm); }
  .data-table th,
  .data-table td { padding: 8px 6px; font-size: 11px; }
  /* Hide lower-priority table columns */
  .data-table .col-hide-xs { display: none; }

  /* Buttons */
  .btn { font-size: 12px; padding: 7px 12px; }
  .btn-lg { font-size: 14px; padding: 10px 16px; }

  /* Filter bars — stack */
  .filter-bar,
  [class*="filter"] { flex-wrap: wrap; }
  .filter-bar > *,
  .filter-bar input,
  .filter-bar select { min-width: 0; flex: 1 1 140px; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-in { animation: fadeInUp 0.35s ease forwards; }

/* ============================================================
   SUBSCRIPTION / LANDING
   ============================================================ */

.plan-card {
  background: #fff;
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  text-align: center;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.plan-card:hover { border-color: var(--blue-400); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.plan-card.featured { border-color: var(--gold-400); box-shadow: var(--shadow-gold); }
.plan-card.featured::before {
  content: 'MOST POPULAR';
  position: absolute; top: 14px; right: -30px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--blue-900);
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 40px;
  transform: rotate(45deg);
}
.plan-price { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--blue-900); }
.plan-price sup { font-size: 18px; vertical-align: super; }
.plan-price span { font-size: 14px; color: var(--grey-400); font-family: var(--font-body); font-weight: 400; }

/* Print styles for receipts */
@media print {
  .sidebar, .topbar, .cart-actions, .no-print { display: none !important; }
  .main-content, .main-wrap { margin-left: 0 !important; }
  .receipt { width: 100%; }
}
