/* ============================================================
   KIOSQUE POS — Light Theme with Green Accents
   Clean, modern, professional design matching reference
   ============================================================ */

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

/* ---------- CSS Variables ---------- */
:root {
  --bg-body: #f5f5f5;
  --bg-white: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f9fafb;
  --bg-hover: #f3f4f6;
  --bg-category: #f3f4f6;

  --border-color: #e5e7eb;
  --border-light: #f0f0f0;

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-white: #ffffff;

  --green-primary: #2d6a2e;
  --green-hover: #245622;
  --green-light: #e8f5e9;
  --green-bg: #f0faf0;
  --green-badge: #2d6a2e;

  --red: #dc2626;
  --red-light: #fef2f2;
  --red-badge: #dc2626;
  --orange: #f59e0b;
  --orange-light: #fffbeb;
  --blue: #3b82f6;
  --blue-light: #eff6ff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);

  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;

  --sidebar-width: 220px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Layout ---------- */
.app-container {
  display: flex;
  min-height: 100vh;
}

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

.sidebar-brand {
  padding: 24px 20px 20px;
}

.sidebar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-primary);
  line-height: 1.2;
}

.sidebar-brand span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

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

.nav-link.active {
  background: var(--green-light);
  color: var(--green-primary);
  font-weight: 600;
}

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

.nav-link .icon {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  opacity: 0.8;
}

.nav-link.active .icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 4px;
}

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

.sidebar-user .user-info {
  flex: 1;
}

.sidebar-user .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-user .user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-footer .nav-link {
  font-size: 0.85rem;
}

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

/* ---------- Top Bar ---------- */
.top-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.search-bar {
  flex: 1;
  max-width: 560px;
  position: relative;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.search-bar .barcode-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.search-bar .barcode-icon:hover {
  color: var(--green-primary);
}

.search-bar input {
  width: 100%;
  padding: 10px 44px 10px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 46, 0.08);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green-primary);
}

.status-badge .dot {
  width: 7px;
  height: 7px;
  background: var(--green-primary);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

.lang-switcher {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lang-btn {
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--green-primary);
  color: white;
}

.lang-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notif-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-secondary);
}

.notif-btn:hover {
  background: var(--bg-hover);
}

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 2px;
}

/* ---------- Category Tabs ---------- */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cat-tab {
  padding: 8px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

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

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

/* ---------- POS Layout ---------- */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  height: calc(100vh - 140px);
}

.pos-main {
  overflow-y: auto;
  padding-right: 4px;
}

/* ---------- Product Grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

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

.product-card .card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--bg-input);
  display: block;
  position: relative;
}

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

.product-card .card-img .stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stock-badge.in-stock {
  background: var(--green-primary);
  color: white;
}

.stock-badge.low-stock {
  background: var(--red);
  color: white;
}

.stock-badge.out-stock {
  background: #6b7280;
  color: white;
}

.product-card .card-info {
  padding: 12px 14px;
}

.product-card .product-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card .product-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green-primary);
  display: inline;
}

.product-card .product-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: inline;
  margin-left: 4px;
}

.product-card .product-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
  display: inline;
}

/* ---------- Order Panel (Cart) ---------- */
.order-panel {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.order-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-header .order-icon {
  font-size: 1.2rem;
  color: var(--green-primary);
}

.order-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.order-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  animation: fadeIn 0.2s ease;
}

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

.order-item .item-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
}

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

.order-item .item-name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-item .item-price {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.order-item .item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.order-item .item-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-primary);
}

.order-item .item-qty button:hover {
  background: var(--bg-hover);
}

.order-item .item-qty span {
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.order-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 18px;
}

.order-calcs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.order-calcs .calc-group label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.order-calcs .calc-group input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
  transition: var(--transition);
}

.order-calcs .calc-group input:focus {
  border-color: var(--green-primary);
}

.order-totals {
  margin-bottom: 14px;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.88rem;
}

.order-total-row.subtotal {
  color: var(--text-secondary);
}

.order-total-row.total {
  font-weight: 800;
  font-size: 1.1rem;
  padding-top: 6px;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.pay-method-btn {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.pay-method-btn:hover {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.pay-method-btn.active {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
}

.complete-sale-btn {
  width: 100%;
  padding: 14px;
  background: var(--green-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.complete-sale-btn:hover {
  background: var(--green-hover);
}

.complete-sale-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.stat-card .stat-icon.green { background: var(--green-light); color: var(--green-primary); }
.stat-card .stat-icon.red { background: var(--red-light); color: var(--red); }
.stat-card .stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-card .stat-icon.blue { background: var(--blue-light); color: var(--blue); }

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

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

.form-control:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 46, 0.08);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover {
  background: var(--green-hover);
}

.btn-success {
  background: var(--green-primary);
  color: white;
}

.btn-success:hover {
  background: var(--green-hover);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

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

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-input);
}

tbody td {
  padding: 12px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-light);
}

tbody tr:hover td {
  background: var(--bg-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: var(--green-light); color: var(--green-primary); }
.badge-warning { background: var(--orange-light); color: var(--orange); }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-info { background: var(--blue-light); color: var(--blue); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-slow);
}

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

.modal {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

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

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red);
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

.toast.toast-success { border-left: 3px solid var(--green-primary); }
.toast.toast-error { border-left: 3px solid var(--red); }
.toast.toast-warning { border-left: 3px solid var(--orange); }
.toast.toast-info { border-left: 3px solid var(--blue); }

.toast-icon { font-size: 1.1rem; }
.toast-message { flex: 1; font-size: 0.85rem; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---------- Login Page ---------- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg-body);
}

.login-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card .login-logo {
  width: 56px;
  height: 56px;
  background: var(--green-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  margin: 0 auto 16px;
}

.login-card h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.login-card .login-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.login-card .form-group {
  text-align: left;
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  margin-top: 8px;
}

/* ---------- Receipt ---------- */
.receipt-preview {
  background: #fff;
  color: #000;
  font-family: 'Courier New', monospace;
  padding: 20px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  max-width: 300px;
  margin: 0 auto;
  font-size: 0.78rem;
}

.receipt-preview .receipt-header {
  text-align: center;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-preview .receipt-items {
  border-bottom: 1px dashed #ccc;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.receipt-preview .receipt-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.receipt-preview .receipt-total {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 0.95rem;
}

/* ---------- Scanner Page ---------- */
.scanner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
  background: var(--bg-body);
}

.scanner-viewer {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--green-primary);
  margin-bottom: 20px;
  position: relative;
  background: #000;
}

.scanner-viewer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scanner-overlay .scan-line {
  width: 80%;
  height: 2px;
  background: var(--green-primary);
  box-shadow: 0 0 10px var(--green-primary);
  animation: scanLine 2s ease-in-out infinite;
}

.scanner-status {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.scanner-result {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  min-width: 280px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Animations ---------- */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes scanLine {
  0%, 100% { transform: translateY(-60px); }
  50% { transform: translateY(60px); }
}

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

/* ---------- Loading ---------- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ---------- Utilities ---------- */
.text-success { color: var(--green-primary); }
.text-danger { color: var(--red); }
.text-warning { color: var(--orange); }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .top-bar {
    padding: 10px 14px;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}
