/* =============================================
   PayGfad POS - Styles
   Professional POS & Stock Management System
   ============================================= */

:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-light: #fbbf24;
  --primary-bg: #fffbeb;
  --secondary: #1f2937;
  --secondary-light: #374151;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --transition: all 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

.login-logo i { color: white; font-size: 28px; }

.login-card h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.login-card p.subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
  background: white;
  color: var(--gray-800);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.form-control::placeholder { color: var(--gray-400); }

select.form-control {
  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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-control-sm { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #2563eb; }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.125rem; font-weight: 700; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
}

.btn-block { width: 100%; }

/* =============================================
   LAYOUT
   ============================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--secondary);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo i { font-size: 18px; }

.sidebar-brand h2 { font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.sidebar-brand span { font-size: 0.6875rem; color: var(--gray-400); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.nav-section {
  padding: 0.5rem 1.5rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: white; }

.nav-item.active {
  background: rgba(245,158,11,0.1);
  color: var(--primary);
  border-left-color: var(--primary);
}

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.6875rem; color: var(--gray-400); text-transform: capitalize; }

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

/* Top header */
.top-header {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-header-left h1 { font-size: 1.25rem; font-weight: 700; }

.shop-badge {
  background: var(--primary-bg);
  color: var(--primary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Content area */
.content-area {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 { font-size: 1rem; font-weight: 700; }

.card-body { padding: 1.25rem; }
.card-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
}

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

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

.kpi-icon.amber { background: #fef3c7; color: #d97706; }
.kpi-icon.green { background: #d1fae5; color: #059669; }
.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }

.kpi-info h4 { font-size: 0.8125rem; color: var(--gray-500); font-weight: 500; }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; }
.kpi-change { font-size: 0.75rem; font-weight: 600; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead { background: var(--gray-50); }

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* =============================================
   BADGES / TAGS
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.375rem;
}

.badge-dot.badge-success::before { background: var(--success); }
.badge-dot.badge-danger::before { background: var(--danger); }
.badge-dot.badge-warning::before { background: var(--warning); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1.125rem; font-weight: 700; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: var(--transition);
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-700); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* =============================================
   POS LAYOUT (Caisse)
   ============================================= */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  height: calc(100vh - var(--header-height) - 3rem);
}

.pos-products {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.pos-search {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  gap: 0.75rem;
}

.pos-search input {
  flex: 1;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--gray-50) 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='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.875rem center;
  transition: var(--transition);
}

.pos-search input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.pos-categories {
  padding: 0.5rem 1rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--gray-100);
}

.pos-categories::-webkit-scrollbar { height: 0; }

.cat-pill {
  padding: 0.375rem 1rem;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  transition: var(--transition);
}

.cat-pill:hover { border-color: var(--primary); color: var(--primary); }

.cat-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.pos-grid::-webkit-scrollbar { width: 6px; }
.pos-grid::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.pos-product-card {
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: white;
  position: relative;
}

.pos-product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(245,158,11,0.15);
  transform: translateY(-2px);
}

.pos-product-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}

.pos-product-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  color: var(--gray-400);
  font-size: 1.25rem;
  overflow: hidden;
}

.pos-product-img img { width: 100%; height: 100%; object-fit: cover; }

.pos-product-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.3;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-product-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.pos-product-stock {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.625rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 8px;
  font-weight: 600;
}

.pos-product-stock.ok { background: #d1fae5; color: #065f46; }
.pos-product-stock.low { background: #fef3c7; color: #92400e; }
.pos-product-stock.out { background: #fee2e2; color: #991b1b; }

/* Cart panel */
.pos-cart {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cart-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary);
  color: white;
}

.cart-header h3 { font-size: 1rem; font-weight: 700; }
.cart-header .cart-count { background: var(--primary); padding: 0.125rem 0.5rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

.cart-item {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--gray-50);
  transition: var(--transition);
}

.cart-item:hover { background: var(--gray-50); }

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.8125rem; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.75rem; color: var(--gray-500); }

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-600);
  transition: var(--transition);
}

.cart-qty button:hover { border-color: var(--primary); color: var(--primary); }

.cart-qty span { min-width: 28px; text-align: center; font-weight: 700; font-size: 0.875rem; }

.cart-item-total { font-weight: 700; font-size: 0.875rem; color: var(--gray-800); min-width: 70px; text-align: right; }

.cart-item-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--danger-bg);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  transition: var(--transition);
}

.cart-item-remove:hover { background: var(--danger); color: white; }

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  padding: 2rem;
}

.cart-empty i { font-size: 3rem; margin-bottom: 1rem; }
.cart-empty p { font-size: 0.875rem; }

.cart-summary {
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
  background: var(--gray-50);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
}

.cart-summary-row.total {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--gray-900);
  border-top: 2px solid var(--gray-300);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.cart-payment {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-100);
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.payment-method {
  padding: 0.5rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.75rem;
  font-weight: 500;
}

.payment-method i { display: block; font-size: 1.125rem; margin-bottom: 0.25rem; }
.payment-method:hover { border-color: var(--primary); }
.payment-method.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); }

.cart-amount-paid { margin-bottom: 0.75rem; }
.cart-change {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 600;
  text-align: center;
  padding: 0.375rem;
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-checkout:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =============================================
   RECEIPT
   ============================================= */
.receipt {
  max-width: 320px;
  margin: 0 auto;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
}

.receipt-header { text-align: center; margin-bottom: 1rem; border-bottom: 1px dashed var(--gray-300); padding-bottom: 1rem; }
.receipt-header h3 { font-size: 1rem; }
.receipt-items { border-bottom: 1px dashed var(--gray-300); padding-bottom: 0.75rem; margin-bottom: 0.75rem; }
.receipt-item { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.receipt-total { font-weight: 700; font-size: 1rem; text-align: right; margin-top: 0.5rem; }

/* =============================================
   TOAST / NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.toast-success { background: #065f46; color: white; }
.toast-error { background: #991b1b; color: white; }
.toast-warning { background: #92400e; color: white; }
.toast-info { background: #1e40af; color: white; }

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  font-size: 1rem;
}

.toast-close:hover { opacity: 1; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1rem 0;
}

.pagination button {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: var(--transition);
}

.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

.pagination-info { font-size: 0.8125rem; color: var(--gray-500); margin: 0 0.5rem; }

/* =============================================
   FILTERS / TOOLBAR
   ============================================= */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 0.5rem; }

.search-box {
  position: relative;
  min-width: 250px;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(245,158,11,0.15); }

.search-box i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 0.875rem; }

/* =============================================
   STOCK INDICATORS
   ============================================= */
.stock-bar {
  width: 60px;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.375rem;
}

.stock-bar-fill { height: 100%; border-radius: 3px; }
.stock-bar-fill.green { background: var(--success); }
.stock-bar-fill.yellow { background: var(--warning); }
.stock-bar-fill.red { background: var(--danger); }

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

/* =============================================
   GRID LAYOUTS
   ============================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* =============================================
   TABS
   ============================================= */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--gray-400);
}

.empty-state i { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.125rem; color: var(--gray-600); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; margin-bottom: 1.5rem; }

/* =============================================
   LOADING
   ============================================= */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 0.75rem;
  color: var(--gray-500);
}

/* =============================================
   PRODUCT IMAGE THUMBNAIL
   ============================================= */
.product-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.875rem;
  overflow: hidden;
  flex-shrink: 0;
}

.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* =============================================
   IMAGE UPLOAD
   ============================================= */
.image-upload {
  width: 120px;
  height: 120px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-400);
  overflow: hidden;
  position: relative;
}

.image-upload:hover { border-color: var(--primary); color: var(--primary); }
.image-upload i { font-size: 1.5rem; margin-bottom: 0.25rem; }
.image-upload span { font-size: 0.6875rem; }

.image-upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .pos-layout { grid-template-columns: 1fr 320px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-products { min-height: 50vh; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* =============================================
   PRINT
   ============================================= */
@media print {
  .sidebar, .top-header, .btn, .toolbar { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 0 !important; }
  .receipt { max-width: 100%; }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.6875rem; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary-dark); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
