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

:root {
  --primary: #15803d;       /* darker green — 4.6:1 on white */
  --primary-hover: #166534;
  --primary-light: #dcfce7;
  --primary-mid: #86efac;
  --accent: #0284c7;        /* darker blue */
  --accent-bg: #e0f2fe;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;        /* darker red — better contrast */
  --danger-bg: #fee2e2;
  --warning: #b45309;       /* darker amber */
  --warning-bg: #fef3c7;
  --text: #111827;          /* 16:1 on white — excellent */
  --text-2: #1f2937;        /* 14:1 — excellent */
  --text-3: #4b5563;        /* 7.4:1 — passes AA + AAA */
  --text-4: #6b7280;        /* 4.6:1 — passes AA for large text, use sparingly */
  --border: #d1d5db;        /* slightly darker for visibility */
  --border-light: #e5e7eb;
  --bg: #f9fafb;
  --bg-2: #f3f4f6;
  --white: #ffffff;
  --radius: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px rgba(0,0,0,0.1), 0 8px 10px rgba(0,0,0,0.04);
  --transition: 0.15s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;         /* increased from 1.5 — easier to read */
  font-size: 15px;          /* increased from 14px base */
  -webkit-font-smoothing: antialiased;
}

/* ===== Login ===== */
.login-container {
  display: flex;
  min-height: 100vh;
  background: var(--white);
}

.login-panel {
  flex: 1;
  background: linear-gradient(160deg, #f0fdf4 0%, #bbf7d0 50%, #86efac 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

/* Subtle background circles */
.login-panel::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  top: -100px; left: -100px;
  border-radius: 50%;
}

.login-panel::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  bottom: -60px; right: -60px;
  border-radius: 50%;
}

.login-panel-content {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
}

.login-panel-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #15803d, #0284c7);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; color: white; letter-spacing: -1px;
  box-shadow: 0 6px 20px rgba(21,128,61,0.35);
  margin-bottom: 20px;
}

.login-panel-title {
  font-size: 32px; font-weight: 900;
  color: #14532d;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}

.login-panel-sub {
  font-size: 15px;
  color: #166534;
  margin-bottom: 28px;
  line-height: 1.5;
  opacity: 0.85;
}

.login-illustration {
  width: 100%;
  max-width: 380px;
  margin-bottom: 28px;
  filter: drop-shadow(0 8px 24px rgba(21,128,61,0.15));
}

.login-panel-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lpf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
  background: rgba(255,255,255,0.5);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.7);
}

.lpf-item svg { flex-shrink: 0; color: #15803d; }

@media (max-width: 768px) {
  .login-panel { display: none; }
}

.login-box {
  width: 100%;
  max-width: 460px;
  padding: 60px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
  box-shadow: -20px 0 60px rgba(0,0,0,0.06);
  position: relative;
  z-index: 1;
  animation: loginIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #16a34a, #0ea5e9);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  box-shadow: 0 8px 20px rgba(22,163,74,0.3);
}

.login-box h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.8px;
  line-height: 1.2;
}

.login-box h1 span {
  background: linear-gradient(135deg, #16a34a, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-box .login-subtitle {
  color: var(--text-3);
  font-size: 14px;
  margin-bottom: 40px;
}

.login-box .form-group label {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.login-box .form-group input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14.5px;
  color: var(--text);
  background: var(--bg);
  transition: all 0.2s ease;
}

.login-box .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

.login-box .btn-primary {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(22,163,74,0.3);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.login-box .btn-primary:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22,163,74,0.4);
}

.login-box .btn-primary:active { transform: translateY(0); }

#login-error { color: var(--danger) !important; font-size: 13px; }

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.1);
}

.form-group .field-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  line-height: 20px;
  white-space: nowrap;
}

.btn::after { display: none; }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #b45309; }

.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover { background: var(--bg); border-color: #d1d5db; }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== Topbar ===== */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

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

.topbar-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #16a34a, #0ea5e9);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: white;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}

.topbar h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.topbar h2 span {
  background: linear-gradient(135deg, #16a34a, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-3);
}

#btn-logout {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

#btn-logout:hover { background: var(--danger-bg); border-color: #fca5a5; color: var(--danger); }

/* ===== Layout ===== */
.app-container { display: none; }
.main-layout { display: flex; height: calc(100vh - 58px); }

/* ===== Sidebar ===== */
.sidebar {
  width: 232px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar .nav-section {
  padding: 18px 16px 5px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
  letter-spacing: 0.7px;
}

.sidebar .nav-section:first-child { padding-top: 6px; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  color: var(--text-3);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin: 1px 8px;
  border-radius: var(--radius-md);
}

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

.sidebar a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.sidebar a.active .nav-icon svg { stroke: var(--primary); }

.sidebar a .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Content ===== */
.content {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  background: var(--bg);
}

.page { display: none; }
.page.active { display: block; }

#page-pos.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
  margin: -24px -28px;
  padding: 0;
}

#page-pos .pos-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  height: 100%;
  min-height: 0;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}

.card h3 {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #16a34a, #0ea5e9);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 6px;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  background: none;
  letter-spacing: -0.5px;
}

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

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

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  border-bottom: 1.5px solid var(--border);
}

td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
  font-size: 14px;
}

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

/* ===== POS Products ===== */
.pos-products {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  padding: 14px;
  gap: 10px;
}

.pos-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--white);
  font-family: var(--font);
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.pos-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.1); }

.category-tabs { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; padding: 2px 0; }
.category-tabs::-webkit-scrollbar { height: 0; }

.cat-tab {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-3);
  font-family: var(--font);
}

.cat-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-tab.active { background: var(--primary); color: var(--white); border-color: var(--primary); box-shadow: 0 2px 8px rgba(22,163,74,0.3); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  align-content: start; /* cards don't stretch vertically when few items */
  padding-bottom: 8px;
}

.product-card {
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  height: 180px; /* fixed height keeps grid uniform */
}

.product-card::before { display: none; }
.product-card:hover { border-color: var(--primary-mid); box-shadow: var(--shadow); transform: translateY(-1px); }

.product-card .p-image { width: 100%; height: 68px; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; background: var(--bg); flex-shrink: 0; }
.product-card .p-placeholder { width: 100%; height: 68px; border-radius: var(--radius); margin-bottom: 8px; background: linear-gradient(135deg, #f0fdf4, #dcfce7); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 20px; font-weight: 800; flex-shrink: 0; }
.product-card .p-name { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .p-price { color: var(--primary); font-weight: 800; font-size: 14px; margin-top: 2px; -webkit-text-fill-color: var(--primary); background: none; }
.product-card .p-stock { font-size: 12px; color: var(--text-3); margin-top: 2px; margin-bottom: 6px; }

.product-card .p-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin-top: auto; padding: 7px 0;
  border: none; border-radius: var(--radius);
  background: var(--primary); color: var(--white);
  font-size: 12px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: all var(--transition); flex-shrink: 0;
}

.product-card .p-add-btn:hover { background: var(--primary-hover); }

/* ===== Cart Panel ===== */
.cart-panel {
  background: var(--white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--white);
}

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

.cart-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 4px; border-bottom: 1px solid var(--border-light); font-size: 13px;
}

.cart-item:hover { background: var(--bg); border-radius: var(--radius); }
.cart-item .ci-name { flex: 1; font-weight: 600; color: var(--text); }
.cart-item .ci-qty { width: 44px; text-align: center; padding: 4px; border: 1.5px solid var(--border); border-radius: var(--radius); font-weight: 700; font-size: 13px; font-family: var(--font); }
.cart-item .ci-qty:focus { border-color: var(--primary); outline: none; }
.cart-item .ci-total { width: 64px; text-align: right; font-weight: 700; color: var(--text); }
.cart-item .ci-remove { background: none; border: none; color: var(--text-4); cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: var(--radius); transition: all var(--transition); }
.cart-item .ci-remove:hover { color: var(--danger); background: var(--danger-bg); }

.cart-footer { border-top: 1px solid var(--border); padding: 14px 16px; background: var(--bg); }

.cart-totals { font-size: 14px; margin-bottom: 12px; }
.cart-totals .row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--text-3); }
.cart-totals .row span:first-child { color: var(--text-2); }
.cart-totals .grand-total {
  font-weight: 800; font-size: 18px; color: var(--text);
  border-top: 2px solid var(--border); padding-top: 10px; margin-top: 6px;
  -webkit-text-fill-color: var(--text); background: none;
}

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

.toast {
  padding: 12px 18px; border-radius: var(--radius-md);
  color: var(--white); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-md); animation: slideIn 0.2s ease; max-width: 360px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17,24,39,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(2px);
}

.modal {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 28px; width: 90%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.18s ease;
  border: 1px solid var(--border-light);
}

@keyframes modalIn {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h3 { margin-bottom: 18px; font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--accent-bg); color: var(--accent); }

/* ===== Utility ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
.hidden { display: none; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

/* ===== Loading ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-4); font-size: 13px; gap: 8px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty States ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-4); }
.empty-state svg { margin-bottom: 10px; opacity: 0.25; }
.empty-state h4 { font-size: 14px; color: var(--text-3); margin-bottom: 4px; font-weight: 700; }
.empty-state p { font-size: 12px; max-width: 260px; margin: 0 auto; }

/* ===== Tooltips ===== */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--white); padding: 5px 10px;
  border-radius: var(--radius); font-size: 12px; white-space: nowrap; z-index: 999;
  box-shadow: var(--shadow-sm);
}

/* ===== Focus & Accessibility ===== */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.skip-link { position: absolute; top: -100px; left: 0; background: var(--primary); color: var(--white); padding: 8px 16px; z-index: 9999; font-weight: 600; }
.skip-link:focus { top: 0; }

/* ===== Quantity Modal ===== */
.qty-btn { width: 40px; height: 40px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--white); font-size: 18px; font-weight: 700; color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--font); transition: all var(--transition); }
.qty-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.qty-minus:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.qty-input { width: 72px; height: 40px; text-align: center; font-size: 20px; font-weight: 800; border: 2px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-family: var(--font); }
.qty-input:focus { border-color: var(--primary); outline: none; }
.qty-modal-img { width: 64px; height: 64px; border-radius: var(--radius-md); object-fit: cover; margin: 0 auto 8px; display: block; }
.qty-modal-placeholder { width: 64px; height: 64px; border-radius: var(--radius-md); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; background: var(--primary-light); color: var(--primary); }

/* ===== Responsive ===== */
@media (min-width: 1400px) {
  /* Cap columns on very wide screens so cards don't get too big */
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 180px)); }
}

@media (max-width: 900px) {
  #page-pos .pos-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 260px; }
  .sidebar { width: 200px; }
}

@media (max-width: 700px) {
  .main-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; overflow-x: auto; padding: 8px; display: flex; gap: 4px; }
  .sidebar .nav-section { display: none; }
  .sidebar a { padding: 8px 12px; white-space: nowrap; margin: 0; }
  .content { padding: 16px; }
  #page-pos.active { margin: -16px; }
  #page-pos .pos-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 240px; }
  .login-box { padding: 40px 28px; max-width: 100%; box-shadow: none; }
}
