/* ═══════════════════════════════════════════════════
   RetailPOS — Design System
   Premium modern POS with indigo/purple palette
   ═══════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────── */
:root {
  /* Primary palette */
  --primary:        #5B21B6;
  --primary-light:  #7C3AED;
  --primary-dark:   #4C1D95;
  --primary-50:     #EDE9FE;
  --primary-100:    #DDD6FE;
  --primary-200:    #C4B5FD;

  /* Sidebar */
  --sidebar-bg:     #1E1B4B;
  --sidebar-hover:  #312E81;
  --sidebar-active: #7C3AED;
  --sidebar-text:   #C7D2FE;
  --sidebar-width:  260px;

  /* Semantic */
  --success:    #059669;
  --success-bg: #D1FAE5;
  --warning:    #D97706;
  --warning-bg: #FEF3C7;
  --danger:     #DC2626;
  --danger-bg:  #FEE2E2;
  --info:       #2563EB;
  --info-bg:    #DBEAFE;

  /* Surfaces */
  --bg:          #F1F5F9;
  --surface:     #FFFFFF;
  --border:      #E2E8F0;
  --border-light:#F1F5F9;

  /* Text */
  --text:       #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;

  /* Misc */
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;
  --shadow:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --transition: .2s cubic-bezier(.4,0,.2,1);

  /* Header */
  --header-h:   64px;
}

/* ── Reset & Base ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  font-size: 14px; 
  -webkit-font-smoothing: antialiased; 
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100%;
  overflow: hidden;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ══════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

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

.logo-icon { font-size: 28px; }

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

/* Nav items */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: rgba(124,58,237,.2);
  color: #fff;
  border-left-color: var(--sidebar-active);
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

.nav-text { white-space: nowrap; }

/* Nav group */
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.nav-group-header:hover { background: var(--sidebar-hover); color: #fff; }

.nav-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform var(--transition);
}

.nav-group-header.open .nav-arrow { transform: rotate(90deg); }

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.nav-group-items.open { max-height: 500px; }

.sub-item { padding-left: 56px; font-size: 13px; }

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 12px 20px;
}

/* ══════════════════════════════════════════════════
   MAIN WRAPPER
   ══════════════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: margin-left var(--transition);
}

.main-wrapper.expanded { margin-left: 0; }

/* ── Top Header ────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.header-left { display: flex; align-items: center; gap: 16px; }

.menu-toggle {
  width: 36px; height: 36px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.menu-toggle:hover { background: var(--border); }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 1px; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.bc-sep { color: var(--text-light); }
.bc-active { color: var(--text); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 16px; }

.header-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Main Content ──────────────────────────────── */
.main-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════ */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 22px 28px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(91,33,182,.25);
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 13px;
  opacity: .85;
  margin-top: 2px;
}

.page-actions { display: flex; gap: 10px; }

/* ══════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body { padding: 20px; }

/* ── Stats Cards ───────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.stat-card.blue::before   { background: var(--info); }
.stat-card.green::before  { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.purple::before { background: var(--primary); }
.stat-card.teal::before   { background: #0D9488; }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card.blue .stat-icon   { background: var(--info-bg); }
.stat-card.green .stat-icon  { background: var(--success-bg); }
.stat-card.orange .stat-icon { background: var(--warning-bg); }
.stat-card.red .stat-icon    { background: var(--danger-bg); }
.stat-card.purple .stat-icon { background: var(--primary-50); }
.stat-card.teal .stat-icon   { background: #CCFBF1; }

.stat-info { flex: 1; min-width: 0; }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91,33,182,.3);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(91,33,182,.4); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #10B981 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.3);
}
.btn-success:hover { box-shadow: 0 4px 14px rgba(5,150,105,.4); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #EF4444 100%);
  color: #fff;
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #F59E0B 100%);
  color: #fff;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ══════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.form-input::placeholder { color: var(--text-light); }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.form-textarea { min-height: 80px; resize: vertical; }

/* Section headers (colored banners inside forms) */
.section-header {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header.purple { background: linear-gradient(135deg, #7C3AED, #A855F7); }
.section-header.yellow { background: linear-gradient(135deg, #D97706, #F59E0B); }
.section-header.green  { background: linear-gradient(135deg, #059669, #10B981); }
.section-header.blue   { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.section-header.red    { background: linear-gradient(135deg, #DC2626, #EF4444); }

/* ══════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
  color: var(--text-secondary);
  padding: 12px 14px;
  text-align: left;
  position: sticky;
  top: 0;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: #F8FAFC; }

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

.data-table .total-row {
  background: var(--warning-bg) !important;
  font-weight: 700;
}

.data-table .total-row td { border-bottom: none; }

/* ══════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: var(--info-bg);    color: var(--info);    }
.badge-primary { background: var(--primary-50); color: var(--primary); }

.badge-label {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ══════════════════════════════════════════════════
   SEARCH & FILTER BAR
   ══════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  background: var(--surface);
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.search-box input:focus { border-color: var(--primary-light); }

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

/* ══════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all .25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.97);
  transition: transform .25s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ══════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transform: translateX(120%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(0); }

.toast-icon { font-size: 18px; }

.toast-success { background: linear-gradient(135deg, #059669, #10B981); }
.toast-error   { background: linear-gradient(135deg, #DC2626, #EF4444); }
.toast-info    { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.toast-warning { background: linear-gradient(135deg, #D97706, #F59E0B); }

/* ══════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════ */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-secondary); }
.text-sm      { font-size: 12px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex     { display: flex; }
.flex-col { flex-direction: column; }
.gap-1    { gap: 8px; }
.gap-2    { gap: 16px; }
.gap-3    { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1   { flex: 1; }

.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Divider text ──────────────────────────────── */
.divider-text {
  display: flex;
  align-items: center;
  color: var(--text-light);
  font-size: 12px;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-text span { padding: 0 12px; }

/* ── Empty state ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: .5;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; }

/* ── Loading splash ────────────────────────────── */
.loading-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pagination ────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination button {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination button:hover { background: var(--bg); border-color: var(--primary-light); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ══════════════════════════════════════════════════
   NEW ORDER SPECIFIC
   ══════════════════════════════════════════════════ */
.order-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.order-summary {
  position: sticky;
  top: 0;
}

.order-summary .summary-header {
  background: linear-gradient(135deg, var(--warning), #F59E0B);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-summary .summary-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.summary-row.total {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 800;
}

.summary-row.total .summary-val { color: var(--success); }

.summary-val { font-weight: 600; }

/* Cart items */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-variant { font-size: 12px; color: var(--text-secondary); }
.cart-item-price { font-size: 13px; color: var(--text-secondary); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.qty-control button {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-control button:hover { background: var(--border); }

.qty-control input {
  width: 40px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  padding: 6px 0;
}

/* Payment split rows */
.payment-row {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.payment-row .form-group { flex: 1; margin-bottom: 0; }

.btn-remove-payment {
  width: 36px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-remove-payment:hover { background: var(--danger); color: #fff; }

/* ── Product search dropdown ───────────────────── */
.product-search-wrap { position: relative; }

.product-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
  z-index: 80;
  box-shadow: var(--shadow-lg);
  display: none;
}

.product-results.open { display: block; }

.product-result-item {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-light);
}

.product-result-item:hover { background: var(--primary-50); }

.product-result-item .pr-name { font-weight: 600; font-size: 13px; }
.product-result-item .pr-sku  { font-size: 11px; color: var(--text-light); }
.product-result-item .pr-price { font-weight: 700; color: var(--primary); }
.product-result-item .pr-stock { font-size: 11px; color: var(--text-light); }

/* ══════════════════════════════════════════════════
   SALES RETURN SPECIFIC
   ══════════════════════════════════════════════════ */
.selected-sale-card {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  position: relative;
}

.selected-sale-card h4 {
  color: var(--warning);
  font-size: 15px;
  margin-bottom: 6px;
}

.selected-sale-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0;
}

.selected-sale-card .close-sale {
  position: absolute;
  right: 16px; top: 16px;
  width: 28px; height: 28px;
  border: none;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════
   CUSTOMER SPECIFIC
   ══════════════════════════════════════════════════ */
.customer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
  position: relative;
}

.customer-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.customer-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.customer-top { display: flex; align-items: center; gap: 14px; }

.customer-name {
  font-size: 16px;
  font-weight: 700;
}

.customer-phone {
  font-size: 13px;
  color: var(--text-secondary);
}

.customer-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.customer-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.customer-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════
   PRODUCT CARDS
   ══════════════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-card-img {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--primary-50), #EDE9FE);
}

.product-card-body { padding: 16px; }

.product-card-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.product-card-sku {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-card-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.product-card-stock {
  font-size: 12px;
  font-weight: 600;
}

.product-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* ══════════════════════════════════════════════════
   CHARTS
   ══════════════════════════════════════════════════ */
.chart-container {
  position: relative;
  width: 100%;
  max-height: 300px;
}

/* ══════════════════════════════════════════════════
   VARIATION BUILDER
   ══════════════════════════════════════════════════ */
.variation-row {
  display: grid;
  grid-template-columns: 1fr 100px 120px 120px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}

.variation-row .form-group { margin-bottom: 0; }

/* ══════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fade-in { animation: fadeIn .3s ease-out; }
.slide-in { animation: slideInRight .3s ease-out; }

/* ══════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════ */
@media print {
  .sidebar, .top-header, .page-actions, .filter-bar, .menu-toggle { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .main-content { padding: 10px !important; height: auto !important; overflow: visible !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
