/* ============================================================
   COMPONENTS.CSS — Reusable UI Components
   Hydrogel Film Business POS
   ============================================================ */

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px var(--space-5);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  color: white;
  box-shadow: var(--shadow-purple);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-800), var(--primary-700)); box-shadow: var(--shadow-purple-lg); }

/* Secondary */
.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-200);
}
.btn-secondary:hover { background: var(--primary-200); }

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

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

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--text-primary); }

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

/* Warning */
.btn-warning {
  background: var(--warning);
  color: white;
}
.btn-warning:hover { background: #d97706; }

/* Sizes */
.btn-xs  { padding: 6px 10px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-sm  { padding: 8px 14px; font-size: var(--text-sm); }
.btn-lg  { padding: 15px var(--space-6); font-size: var(--text-md); border-radius: var(--radius-lg); }
.btn-xl  { padding: 18px var(--space-8); font-size: var(--text-lg); border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; aspect-ratio: 1; }
.btn-icon-sm { padding: 7px; aspect-ratio: 1; }

/* Loading state */
.btn.loading { pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn.loading > * { opacity: 0; }

/* Ripple Effect */
.btn::after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
}
.btn:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}
/* Override for loading state */
.btn.loading::after {
  background-image: none;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 13px var(--space-4);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.25);
}

.form-control:disabled {
  background: var(--gray-100);
  color: var(--text-muted);
  cursor: not-allowed;
}

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

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  font-weight: var(--weight-medium);
}

/* Select */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Textarea */
textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Search Input */
.search-box {
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box .search-icon svg { width: 16px; height: 16px; }

.search-box .form-control {
  padding-left: 42px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-bounce);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }

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

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.8);
}

.card-purple {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
  border: none;
  box-shadow: var(--shadow-purple-lg);
}

.card-body {
  padding: var(--space-4);
}

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

.card-header h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}

/* Stat Card */
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
}

.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card.purple .stat-card-value { color: var(--primary); }
.stat-card.green .stat-card-value { color: var(--success); }
.stat-card.amber .stat-card-value { color: var(--warning); }
.stat-card.red .stat-card-value { color: var(--danger); }
.stat-card.blue .stat-card-value { color: #0177FF; }

.stat-card.purple .stat-card-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.green .stat-card-icon { background: var(--success-light); color: var(--success); }
.stat-card.amber .stat-card-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.red .stat-card-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.blue .stat-card-icon { background: rgba(1, 119, 255, 0.12); color: #0177FF; }

/* ═══════════════════════════════════════════════════════════
   BADGES & PILLS
   ═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
}

.badge-purple  { background: rgba(0, 180, 255, 0.18); color: #00D2FF; }
.badge-green   { background: rgba(16, 185, 129, 0.18); color: #34D399; }
.badge-amber   { background: rgba(245, 158, 11, 0.18); color: #FBBF24; }
.badge-red     { background: rgba(239, 68, 68, 0.18);  color: #F87171; }
.badge-gray    { background: #1E293B; color: #94A3B8; }
.badge-blue    { background: rgba(56, 189, 248, 0.18); color: #38BDF8; }

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ═══════════════════════════════════════════════════════════
   LIST ITEMS
   ═══════════════════════════════════════════════════════════ */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  transition: background var(--transition-fast);
}

.list-item:last-child { border-bottom: none; }
.list-item:active, .list-item.clickable:hover { background: var(--gray-50); }
.list-item.clickable { cursor: pointer; }

.list-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-icon svg { width: 20px; height: 20px; }

.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-right { text-align: right; flex-shrink: 0; }

/* Avatar */
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-2xl); }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  padding: 0;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg-surface);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  box-shadow: var(--shadow-xl);
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--transition-bounce);
  position: relative;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

/* Desktop — center modal */
@media (min-width: 768px) {
  .modal-overlay { align-items: center; padding: var(--space-6); }
  .modal {
    border-radius: var(--radius-2xl);
    transform: translateY(20px) scale(0.97);
    max-height: 90vh;
  }
  .modal-overlay.open .modal { transform: translateY(0) scale(1); }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  margin: var(--space-3) auto var(--space-1);
}

.modal-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.modal-close:hover { background: var(--gray-200); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

@media (min-width: 480px) {
  .toast-container {
    left: auto;
    max-width: 380px;
  }
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid transparent;
  pointer-events: all;
  animation: slideInRight 0.3s var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.toast.removing { animation: slideOutRight 0.3s ease forwards; }

.toast-icon svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.toast-message { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }

.toast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  flex-shrink: 0;
}
.toast-close svg { width: 14px; height: 14px; }

.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    { border-left-color: var(--info); }
.toast.info    .toast-icon { color: var(--info); }

/* Progress bar */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  animation: toastProgress 4s linear forwards;
  opacity: 0.3;
}

/* ═══════════════════════════════════════════════════════════
   CONFIRMATION DIALOG
   ═══════════════════════════════════════════════════════════ */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.confirm-dialog.open {
  opacity: 1;
  pointer-events: all;
}

.confirm-box {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition-bounce);
  text-align: center;
}

.confirm-dialog.open .confirm-box { transform: scale(1); }

.confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.confirm-icon.danger { background: var(--danger-light); color: var(--danger); }
.confirm-icon.warning { background: var(--warning-light); color: var(--warning); }
.confirm-icon.info { background: var(--info-light); color: var(--info); }
.confirm-icon svg { width: 28px; height: 28px; }

.confirm-title { font-size: var(--text-lg); font-weight: var(--weight-bold); margin-bottom: var(--space-2); }
.confirm-message { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-6); line-height: var(--leading-relaxed); }

.confirm-actions { display: flex; gap: var(--space-3); }
.confirm-actions .btn { flex: 1; }

/* ═══════════════════════════════════════════════════════════
   LOADING / SKELETON
   ═══════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-top);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

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

.loading-spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 14px; border-radius: var(--radius-xs); margin-bottom: var(--space-2); }
.skeleton-text.sm { height: 11px; }
.skeleton-text.lg { height: 20px; }
.skeleton-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card { height: 80px; border-radius: var(--radius-xl); }
.skeleton-btn { height: 42px; border-radius: var(--radius-md); }

/* ═══════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-xl); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table .td-bold { font-weight: var(--weight-semibold); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════ */
.progress-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary-700), var(--primary-500));
  transition: width 0.6s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressSheen 2s infinite;
}

/* ═══════════════════════════════════════════════════════════
   FAB (Floating Action Button)
   ═══════════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(var(--nav-bottom-height) + 16px);
  right: var(--space-5);
  z-index: var(--z-nav);
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-purple-lg);
  cursor: pointer;
  color: white;
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
}
.fab:hover { transform: scale(1.08); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════════════════════════
   CHIP / TAG
   ═══════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.chip.selected {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-300);
}

.chip-close {
  color: currentColor;
  opacity: 0.6;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  padding: 0;
}
.chip-close svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════════════════════
   DIVIDER WITH TEXT
   ═══════════════════════════════════════════════════════════ */
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════════════════
   PAGE TRANSITION
   ═══════════════════════════════════════════════════════════ */
.page-enter {
  animation: fadeSlideUp 0.3s ease forwards;
}

/* ═══════════════════════════════════════════════════════════
   PRODUCT / CATEGORY GRID CARDS (POS)
   ═══════════════════════════════════════════════════════════ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 400px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 100px;
}

.product-card:hover, .product-card:active {
  border-color: var(--primary-400);
  background: var(--primary-50);
  transform: scale(0.98);
}

.product-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.product-card-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.product-card-price {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--primary);
}

/* Category Chip Row */
.category-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.category-scroll::-webkit-scrollbar { display: none; }

/* Cart Item */
.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.cart-item-price { font-size: var(--text-xs); color: var(--text-muted); }

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}
.qty-btn:active { transform: scale(0.9); }
.qty-value { min-width: 28px; text-align: center; font-weight: var(--weight-bold); font-size: var(--text-sm); }

/* Payment Method Selection */
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.payment-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
  text-align: center;
}

.payment-option:active { transform: scale(0.97); }
.payment-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.payment-option-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.payment-option-icon svg { width: 24px; height: 24px; }
.payment-option-label { font-size: var(--text-sm); font-weight: var(--weight-semibold); }

/* ═══════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: var(--space-1) 0;
}
.filter-bar::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════════════════
   STEP INDICATOR
   ═══════════════════════════════════════════════════════════ */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }

.step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.step.active .step-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.step.done .step-dot {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.step-line {
  flex: 0 0 20px;
  height: 2px;
  background: var(--border);
}

.step.done + .step .step-line { background: var(--success); }

/* ═══════════════════════════════════════════════════════════
   NUMERIC KEYPAD
   ═══════════════════════════════════════════════════════════ */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.numpad-key {
  height: 64px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.numpad-key:active { background: var(--primary-light); color: var(--primary); transform: scale(0.95); }
.numpad-key.backspace { font-size: var(--text-base); }
.numpad-key.zero { grid-column: span 2; }

/* ═══════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════ */
.separator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.separator-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
}
.info-row-label { font-size: var(--text-sm); color: var(--text-muted); }
.info-row-value { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }
.info-row-value.total { font-size: var(--text-lg); color: var(--primary); font-weight: var(--weight-extrabold); }

/* Status Dot Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.active, .status-dot.approved { background: var(--success); }
.status-dot.inactive, .status-dot.rejected { background: var(--danger); }
.status-dot.pending, .status-dot.waiting { background: var(--warning); animation: pulse 2s infinite; }
.status-dot.closed { background: var(--gray-400); }

/* Pull to Refresh visual cue */
.pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ═══════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════ */
.tabs { display: flex; background: var(--bg-surface); border-radius: var(--radius-xl); padding: 4px; gap: 2px; border: 1px solid var(--border); }
.tab { flex: 1; padding: 10px var(--space-3); border-radius: var(--radius-lg); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-muted); background: transparent; border: none; cursor: pointer; transition: all var(--transition-fast); }
.tab.active { background: var(--primary); color: white; box-shadow: var(--shadow-purple); }
.tab:hover:not(.active) { background: var(--primary-light); color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   CHIPS / CATEGORY FILTER
   ═══════════════════════════════════════════════════════════ */
.chip { display: inline-flex; align-items: center; padding: 7px 16px; border-radius: 20px; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); background: var(--bg-surface); border: 1.5px solid var(--border); cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: all var(--transition-fast); }
.chip.selected { background: var(--primary); color: white; border-color: var(--primary); }
.chip:hover:not(.selected) { border-color: var(--primary); color: var(--primary); }
.category-scroll { display: flex; gap: var(--space-2); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.category-scroll::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════════════════
   PAYMENT OPTIONS GRID
   ═══════════════════════════════════════════════════════════ */
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.payment-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-4) var(--space-3); border-radius: var(--radius-xl); border: 2px solid var(--border); background: var(--bg-surface); cursor: pointer; transition: all var(--transition-fast); }
.payment-option:active { transform: scale(0.97); }
.payment-option.selected { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.payment-option-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.payment-option-label { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-secondary); text-align: center; }
.payment-option.selected .payment-option-label { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════ */
.dashboard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
.stat-card { background: var(--bg-surface); border-radius: var(--radius-xl); padding: var(--space-4); border: 1px solid var(--border); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.stat-card.purple::before { background: var(--primary); }
.stat-card.green::before  { background: var(--success); }
.stat-card.amber::before  { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.blue::before   { background: #0177FF; }
.stat-card-label { font-size: var(--text-xs); color: var(--text-muted); font-weight: var(--weight-medium); margin-bottom: var(--space-2); }
.stat-card-value { font-size: var(--text-xl); font-weight: var(--weight-extrabold); color: var(--text-primary); line-height: 1.1; }
.stat-card-sub   { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════
   LIST ITEMS
   ═══════════════════════════════════════════════════════════ */
.list-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); transition: background var(--transition-fast); }
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg-app); }

/* ═══════════════════════════════════════════════════════════
   PRODUCT GRID (POS)
   ═══════════════════════════════════════════════════════════ */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 480px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
.product-card { background: var(--bg-surface); border-radius: var(--radius-xl); border: 1.5px solid var(--border); padding: var(--space-4); cursor: pointer; transition: all var(--transition-fast); display: flex; flex-direction: column; gap: var(--space-2); }
.product-card:active { transform: scale(0.97); background: var(--primary-light); border-color: var(--primary); }
.product-card-name  { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); line-height: 1.3; }
.product-card-price { font-size: var(--text-md); font-weight: var(--weight-extrabold); color: var(--primary); }
.product-card-cat   { font-size: var(--text-xs); color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   CART ITEMS
   ═══════════════════════════════════════════════════════════ */
.cart-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.cart-item-name { flex: 1; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-primary); }
.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg-surface); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--text-primary); transition: all var(--transition-fast); flex-shrink: 0; }
.qty-btn:active { transform: scale(0.9); background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.qty-value { min-width: 28px; text-align: center; font-size: var(--text-sm); font-weight: var(--weight-bold); }
.cart-item-price { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--primary); min-width: 56px; text-align: right; }

/* ═══════════════════════════════════════════════════════════
   SUCCESS CHECK
   ═══════════════════════════════════════════════════════════ */
.success-check { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--success), #34d399); display: flex; align-items: center; justify-content: center; margin: 0 auto; color: white; box-shadow: 0 8px 25px rgba(16,185,129,0.35); animation: successPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.success-check svg { width: 44px; height: 44px; }
@keyframes successPop { 0% { transform: scale(0) rotate(-10deg); opacity: 0; } 60% { transform: scale(1.1) rotate(5deg); } 100% { transform: scale(1) rotate(0deg); opacity: 1; } }

/* ═══════════════════════════════════════════════════════════
   SKELETONS
   ═══════════════════════════════════════════════════════════ */
.skeleton-card   { height: 120px; border-radius: var(--radius-xl); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.skeleton-text   { height: 14px; border-radius: 6px; margin-bottom: 6px; }
.skeleton-text.sm { height: 11px; }

/* ═══════════════════════════════════════════════════════════
   DIVIDER WITH TEXT
   ═══════════════════════════════════════════════════════════ */
.divider-text { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; padding: var(--space-4) 0 var(--space-2); }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ═══════════════════════════════════════════════════════════
   CARD VARIANT
   ═══════════════════════════════════════════════════════════ */
.card-purple { background: linear-gradient(135deg, var(--primary-700), var(--primary-500)); border: none; }

/* ═══════════════════════════════════════════════════════════
   FLEX UTILITIES
   ═══════════════════════════════════════════════════════════ */
.flex         { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.hidden       { display: none !important; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted   { color: var(--text-muted); }
.animate-fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════
   SHARED ADMIN UI KIT — colored icon tiles, hero banner glow,
   two-column sidebar layout. Used across admin pages for a
   consistent, modern look on both PC and phone. Purely additive;
   nothing here overrides existing classes.
   ═══════════════════════════════════════════════════════════ */

/* Colored icon-tile link cards (nav grids: quick tools, etc.) */
.qmt-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; text-align: center; background: var(--bg-app);
  border: 1px solid var(--border); text-decoration: none; color: var(--text-primary);
  border-radius: 14px; transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}
.qmt-badge {
  width: 44px; height: 44px; border-radius: 12px; font-size: 20px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qmt-label { font-weight: 700; font-size: 13px; }
.qmt-card:active { transform: scale(.96); }
@media (hover: hover) {
  .qmt-card:hover { transform: translateY(-2px); border-color: var(--primary); }
}

/* Decorative glow for purple hero/banner cards (visual only) */
.admin-hero { position: relative; overflow: hidden; }
.admin-hero::before {
  content: ''; position: absolute; top: -70px; right: -50px; width: 220px; height: 220px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.20), transparent 70%); pointer-events: none;
}
.admin-hero::after {
  content: ''; position: absolute; bottom: -90px; left: -30px; width: 180px; height: 180px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%); pointer-events: none;
}
.admin-hero .card-body { position: relative; z-index: 1; }

/* Two-column layout: stacked on mobile, sidebar on wide screens */
.adm-main > *:not(:last-child) { margin-bottom: var(--space-4); }
.adm-side > *:not(:last-child) { margin-bottom: var(--space-4); }
@media (min-width: 1100px) {
  .adm-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); gap: var(--space-4); align-items: start; }
  .adm-main, .adm-side { margin-bottom: 0; }
}

/* Generic card hover lift, for plain nav/list cards across admin pages */
.adm-hover-card { transition: border-color .15s ease, transform .15s ease; }
.adm-hover-card:hover { border-color: rgba(124, 58, 237, .35); }
@media (hover: hover) {
  .adm-hover-card.adm-lift:hover { transform: translateY(-2px); }
}
