/* ============================================
   MultiPOS – Premium Dark Theme CSS
   ============================================ */

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

:root {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #818cf8;
  --secondary:     #0ea5e9;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;

  --bg-dark:       #0f172a;
  --bg-card:       #1e293b;
  --bg-sidebar:    #0f172a;
  --bg-input:      #1e293b;
  --bg-hover:      #334155;

  --border:        rgba(255,255,255,0.08);
  --border-light:  rgba(255,255,255,0.05);

  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --text-secondary:#cbd5e1;

  --sidebar-width: 260px;
  --topbar-height: 65px;

  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;

  --shadow:        0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.25);
  --shadow-glow:   0 0 30px rgba(99,102,241,0.15);

  --transition:    0.2s ease;
}

[data-theme="light"] {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #818cf8;
  --secondary:     #0ea5e9;
  
  --bg-dark:       #f4f6f8;
  --bg-card:       #ffffff;
  --bg-sidebar:    #ffffff;
  --bg-input:      #ffffff;
  --bg-hover:      #f1f5f9;

  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-secondary:#334155;

  --shadow:        0 4px 24px rgba(0,0,0,0.04);
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.02);
  --shadow-glow:   0 0 30px rgba(99,102,241,0.15);
}

[data-theme="light"] .theme-icon::before {
  content: "\f185"; /* fa-sun */
}

[data-theme="light"] .table th {
  background: rgba(0,0,0,0.03) !important;
}
[data-theme="light"] .table tr:hover td { 
  background: rgba(0,0,0,0.02) !important; 
}
[data-theme="light"] .table {
  --bs-table-striped-bg: rgba(0,0,0,0.02);
  --bs-table-hover-bg: rgba(0,0,0,0.04);
}
[data-theme="light"] .modal-header {
  background: rgba(0,0,0,0.02) !important;
}
[data-theme="light"] .form-control::file-selector-button {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text);
}
[data-theme="light"] .form-control:hover::file-selector-button {
  background-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.3);
}
[data-theme="light"] .sidebar-brand .brand-name {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="light"] .nav-item.active {
  color: var(--primary-dark);
  font-weight: 700;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: -4px;
}

.store-switcher {
  margin: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.store-switcher:hover { border-color: var(--primary); }

.store-switcher .store-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-switcher .store-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(14,165,233,0.1));
  color: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.nav-item .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: var(--transition);
}

.sidebar-footer a:hover { background: var(--bg-hover); color: var(--text); }

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar .breadcrumb a { color: var(--primary-light); text-decoration: none; }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.topbar-btn {
  width: 38px; height: 38px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.topbar-btn:hover { color: var(--text); border-color: var(--primary); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  cursor: pointer;
}

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

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, var(--stat-color, var(--primary)) 0%, transparent 70%);
  opacity: 0.1;
  border-radius: 50%;
  transform: translate(20px, -20px);
}

.stat-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--stat-color, var(--primary)), color-mix(in srgb, var(--stat-color, var(--primary)) 70%, #000));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  flex-shrink: 0;
}

.stat-content { flex: 1; }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin: 2px 0;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

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

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

.form-control, .form-select {
  width: 100%;
  background: var(--bg-input) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text) !important;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Dropdowns & Options */
.form-select option {
  background: var(--bg-card);
  color: var(--text);
}

.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dropdown-item {
  color: var(--text-secondary);
  font-size: 13.5px;
  padding: 8px 16px;
  transition: var(--transition);
}

.dropdown-item:hover, .dropdown-item:focus {
  background: var(--bg-hover);
  color: var(--text);
}

.dropdown-item.active, .dropdown-item:active {
  background: var(--primary);
  color: #fff;
}

.dropdown-divider {
  border-color: var(--border);
}

/* File Inputs */
.form-control::file-selector-button {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 0;
  border-right: 1px solid var(--border);
  padding: 8px 16px;
  margin-right: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.form-control:hover::file-selector-button {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(99,102,241,0.4); }

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(16,185,129,0.4); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: #fff;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(239,68,68,0.4); }

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: #fff;
}
.btn-warning:hover { transform: translateY(-1px); }

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

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-xl { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 9px; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-secondary);
  --bs-table-striped-bg: rgba(255,255,255,0.02);
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.table > :not(caption) > * > * {
  background-color: transparent !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

.table th {
  background: rgba(255,255,255,0.03) !important;
  color: var(--text-muted) !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border) !important;
  white-space: nowrap;
}

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

.table tr:hover td { background: rgba(255,255,255,0.02) !important; }
.table tr:last-child td { border-bottom: none !important; }

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

.badge-primary  { background: rgba(99,102,241,0.15);  color: var(--primary-light); }
.badge-success  { background: rgba(16,185,129,0.15);  color: #34d399; }
.badge-danger   { background: rgba(239,68,68,0.15);   color: #f87171; }
.badge-warning  { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.badge-info     { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.badge-muted    { background: rgba(148,163,184,0.1);  color: var(--text-muted); }

/* ══════════════════════════════════════
   ALERTS
══════════════════════════════════════ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-danger  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3);  color: #60a5fa; }

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border) !important;
  background: rgba(255,255,255,0.02) !important;
}
.modal-footer { border-top: 1px solid var(--border) !important; }
.modal-title { font-weight: 700; }
.btn-close { filter: invert(1) opacity(0.5); }
.modal-body { color: var(--text); }
/* Nested cards inside modals */
.modal-body .card { background: var(--bg-dark); border-color: var(--border) !important; }
.modal-body .card-header { background: transparent !important; border-color: var(--border) !important; }
.modal-body .card-header .card-title { color: var(--text) !important; font-size: 13px; }
.modal-body .table th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.modal-body .table td { color: var(--text); font-size: 13px; border-color: var(--border-light); }
.modal-body .table { border-color: var(--border-light); }

/* ══════════════════════════════════════
   UTILITY
══════════════════════════════════════ */
.text-primary   { color: var(--primary-light) !important; }
.text-success   { color: #34d399 !important; }
.text-danger    { color: #f87171 !important; }
.text-warning   { color: #fbbf24 !important; }
.text-muted     { color: var(--text-muted) !important; }

.fw-bold   { font-weight: 700; }
.fw-bolder { font-weight: 800; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 15px; }

/* Spinner */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  top: -200px; left: -200px;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(14,165,233,0.1) 0%, transparent 70%);
  bottom: -150px; right: -150px;
  pointer-events: none;
}

.auth-box {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 42px 40px;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo .logo-icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
}

.auth-logo .logo-text {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-link {
  color: var(--primary-light);
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   POS SCREEN
══════════════════════════════════════ */
body.pos-body {
  overflow: hidden;
}

.pos-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.pos-products {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-dark);
}

.pos-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pos-header-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pos-brand { font-size: 16px; font-weight: 800; letter-spacing: -0.5px; white-space: nowrap; }

.pos-search-area {
  flex: 1;
  display: flex;
  gap: 8px;
  max-width: 600px;
  min-width: 200px;
}

.search-box { position: relative; flex: 1; min-width: 80px; }
.search-box.barcode { flex: 0.35; min-width: 100px; }
.search-box i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); opacity: 0.5;
  pointer-events: none;
  font-size: 14px;
}
.pos-search {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 12px 8px 38px;
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
}
.pos-search:focus { border-color: var(--primary); background: var(--bg-hover); }

.pos-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.pos-customer-select { position: relative; }
.customer-input-group {
  display: flex; align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 240px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.customer-input-group:focus-within { border-color: var(--primary); background: var(--bg-hover); }
.customer-input-group i { padding: 0 12px; color: var(--primary-light); font-size: 14px; opacity: 0.7; }
.customer-input-group input {
  border: none; background: transparent !important; color: var(--text) !important;
  padding: 10px 4px; font-size: 13px; outline: none; flex: 1; font-weight: 500;
}
.customer-input-group input::placeholder { color: var(--text-muted); opacity: 0.5; }

.customer-dropdown-results {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; z-index: 9999; max-height: 280px;
  overflow-y: auto; margin-top: 8px; box-shadow: 0 15px 45px rgba(0,0,0,0.5);
}
.cust-result-item {
  padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
.cust-result-item:hover { background: var(--bg-hover); }
.cust-result-item:last-child { border-bottom: none; }

.customer-selected-group {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 4px 12px;
  min-width: 240px;
  height: 42px;
  box-shadow: var(--shadow-glow);
}
.cus-info { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.cus-name { font-size: 13px; font-weight: 700; color: var(--primary-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cus-meta { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.btn-cus-change {
  border: none; background: transparent; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 4px;
  transition: var(--transition);
}
.btn-cus-change:hover { color: var(--danger); transform: rotate(90deg); }

.divider-v { width: 1px; height: 24px; background: var(--border); }

.pos-actions { display: flex; align-items: center; gap: 6px; }
.pos-actions .btn-icon { width: 38px; height: 38px; border-radius: 8px; font-size: 16px; }

.pos-categories {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.pos-categories::-webkit-scrollbar { height: 4px; }
.pos-categories::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.cat-btn {
  padding: 6px 16px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--transition);
}
.cat-btn:hover { border-color: var(--primary); color: #fff; }
.cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 10px rgba(99,102,241,0.2); }

.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  align-content: start;
}

@media (max-width: 1400px) {
  .pos-search-area { max-width: 400px; }
  .pos-brand { display: none; }
}

@media (max-width: 1200px) {
  .pos-header { padding: 10px; }
  .pos-search-area { order: 3; flex: 1 0 100%; max-width: none; margin-top: 5px; }
  .pos-header-right { flex: 1; justify-content: flex-end; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 768px) {
  .pos-actions .btn-danger span { display: none; }
  .customer-input-group { min-width: 150px; }
  .pos-cart { width: 300px; }
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99,102,241,0.2);
}

.product-card:active { transform: scale(0.97); }

.product-card.out-of-stock {
  opacity: 0.5;
  pointer-events: none;
}

.product-card img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.product-card .p-icon {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(14,165,233,0.1));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 8px;
  color: var(--primary-light);
}

.product-card .p-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.product-card .p-stock {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 9px;
  background: var(--bg-dark);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Cart Panel */
.pos-cart {
  width: 380px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.cart-title { font-size: 16px; font-weight: 800; }

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

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.cart-item:hover { border-color: var(--border); }

.cart-item .ci-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cart-item .ci-price { font-size: 12px; color: var(--text-muted); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 24px; height: 24px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
}
.qty-btn:hover { background: var(--primary); border-color: var(--primary); }

.qty-input {
  width: 40px;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 2px 4px;
}

.ci-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 56px;
  text-align: right;
}

.ci-del {
  color: var(--danger);
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
  font-size: 14px;
}
.ci-del:hover { opacity: 1; }

/* Cart Summary */
.cart-summary {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  background: rgba(255,255,255,0.01);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.summary-row.total {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.summary-row.total span:last-child { color: var(--primary-light); }

/* Discount row */
.discount-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.discount-row select {
  width: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 12px;
}

.discount-row input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
}

.cart-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-checkout {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
}
.btn-checkout:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.35); }
.btn-checkout:disabled { opacity: 0.5; pointer-events: none; }

/* Payment modal */
.payment-tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.pay-method-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.pay-method-btn:hover, .pay-method-btn.active {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99,102,241,0.1);
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.numpad-btn {
  padding: 14px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.numpad-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.numpad-btn.clear { color: var(--danger); }
.numpad-btn.backspace { color: var(--warning); }

/* ══════════════════════════════════════
   RECEIPT
══════════════════════════════════════ */
@media print {
  body * { visibility: hidden; }
  .receipt-print, .receipt-print * { visibility: visible; }
  .receipt-print {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
  }
  .no-print { display: none !important; }
}

.receipt-container {
  max-width: 380px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.receipt-brand { text-align: center; margin-bottom: 16px; }
.receipt-brand h2 { font-size: 20px; font-weight: 800; }
.receipt-brand p { font-size: 12px; color: var(--text-muted); }

.receipt-divider { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }

.receipt-table { width: 100%; font-size: 12px; }
.receipt-table th { color: var(--text-muted); font-weight: 600; text-align: left; padding: 4px 0; }
.receipt-table td { padding: 4px 0; }
.receipt-table .text-right { text-align: right; }

.receipt-totals { font-size: 13px; }
.receipt-totals .r-row { display: flex; justify-content: space-between; padding: 3px 0; }
.receipt-totals .grand { font-size: 16px; font-weight: 800; padding-top: 8px; }

.receipt-footer-text { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 16px; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 230px; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .pos-cart { width: 320px; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
