/* ================================================================
   POS/Cashier System - Complete Stylesheet
   Design: Modern retail POS, dark teal primary, white cards, amber accents
   ================================================================ */

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

:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --primary-bg: #f0fdfa;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Navbar --- */
.navbar {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 8px; }
.nav-logo { font-size: 24px; }
.nav-title { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.nav-links { display: flex; gap: 2px; }
.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-link.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }
.nav-info { font-size: 13px; color: rgba(255,255,255,0.7); }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* --- Page Container --- */
.page-container { padding: 0; min-height: calc(100vh - 56px); }
.page { animation: fadeIn 0.25s ease; }
.page-hidden { display: none; }
.page-content { max-width: 1300px; margin: 0 auto; padding: 20px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Page Topbar --- */
.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.page-topbar h2 { font-size: 20px; color: var(--primary-dark); }
.filter-input, .filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.filter-input:focus, .filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,0.1); }
.filter-input { width: 200px; }
.filter-select { width: 140px; cursor: pointer; }
.btn-back {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: var(--transition);
}
.btn-back:hover { background: var(--border); }

/* --- Buttons --- */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--border); }

/* ================================================================
   CASHIER PAGE
   ================================================================ */
.cashier-layout {
  display: flex;
  height: calc(100vh - 56px);
}
.cashier-products {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--white);
}
.cashier-cart {
  width: 420px;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

/* --- Products Header --- */
.products-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.search-box { display: flex; align-items: center; position: relative; }
.search-input {
  flex: 1;
  padding: 10px 14px 10px 38px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  background: var(--bg);
}
.search-input:focus { border-color: var(--primary); background: var(--white); }
.search-icon { position: absolute; left: 12px; font-size: 16px; color: var(--text-lighter); }
.scan-btn {
  margin-left: 8px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}
.scan-btn:hover { background: var(--primary-dark); }

/* --- Category Tabs --- */
.category-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
}
.cat-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  color: var(--text);
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Products Grid --- */
.products-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  align-content: start;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-height: 150px;
  justify-content: space-between;
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.product-card:active { transform: scale(0.97); }
.product-card.out-of-stock { opacity: 0.5; pointer-events: none; }
.product-emoji { font-size: 36px; line-height: 1; margin-bottom: 6px; }
.product-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.product-price::before { content: '¥'; font-size: 12px; }
.product-stock { font-size: 11px; color: var(--text-lighter); margin-top: 2px; }
.product-add-btn {
  margin-top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.product-add-btn:hover { background: var(--primary-dark); transform: scale(1.1); }

/* --- Cart --- */
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--primary-bg);
}
.cart-header h3 { font-size: 17px; color: var(--primary-dark); }
.btn-clear {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-clear:hover { background: var(--danger-light); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-lighter);
}
.cart-empty-icon { font-size: 56px; margin-bottom: 12px; }
.cart-empty-hint { font-size: 13px; color: var(--text-lighter); }

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 6px;
  background: var(--bg);
  border-radius: var(--radius);
  animation: slideIn 0.2s ease;
  border: 1px solid transparent;
  transition: var(--transition);
}
.cart-item:hover { border-color: var(--border); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 13px; color: var(--accent); font-weight: 600; }
.cart-item-subtotal { font-size: 13px; color: var(--accent); font-weight: 700; min-width: 50px; text-align: right; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  line-height: 1;
}
.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.qty-btn:active { transform: scale(0.9); }
.qty-num { font-size: 14px; font-weight: 600; width: 24px; text-align: center; }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-lighter);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  transition: var(--transition);
}
.cart-item-remove:hover { color: var(--danger); }
.cart-item-flash { animation: itemFlash 0.3s ease; }
@keyframes itemFlash { 50% { background: #d1fae5; transform: scale(1.03); } }

/* --- Cart Summary --- */
.cart-summary {
  padding: 12px 16px;
  border-top: 2px solid var(--primary-bg);
  background: var(--white);
}
.cart-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
  color: var(--text);
}
.cart-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

/* --- Discount --- */
.cart-discount {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: #fffbeb;
}
.discount-label, .payment-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}
.discount-input-row { display: flex; gap: 6px; align-items: center; }
.discount-input {
  width: 70px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
  outline: none;
}
.discount-input:focus { border-color: var(--accent); }
.btn-discount-preset {
  padding: 6px 10px;
  border: 1px solid var(--accent);
  background: var(--white);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-discount-preset:hover { background: var(--accent); color: white; }

/* --- Payment --- */
.cart-payment {
  padding: 10px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.payment-methods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.payment-btn {
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
  line-height: 1.4;
  color: var(--text);
}
.payment-btn:hover { border-color: var(--primary); background: var(--primary-bg); }
.payment-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 3px rgba(15,118,110,0.2);
}
.btn-checkout {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
}
.btn-checkout:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }
.btn-checkout:active { transform: scale(0.98); }
.btn-checkout:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

/* ================================================================
   ORDERS PAGE
   ================================================================ */
.order-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.orders-list { display: flex; flex-direction: column; gap: 8px; }
.order-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-left: 4px solid var(--primary);
}
.order-card:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.order-card-header { display: flex; align-items: center; gap: 12px; }
.order-number { font-weight: 700; font-size: 15px; color: var(--primary-dark); }
.order-time { font-size: 13px; color: var(--text-light); }
.order-info { text-align: right; }
.order-amount { font-size: 18px; font-weight: 700; color: var(--accent); }
.order-meta { font-size: 13px; color: var(--text-light); }
.order-status {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.order-status.paid { background: #d1fae5; color: #065f46; }
.order-status.refunded { background: #fee2e2; color: #991b1b; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}
.page-btn:hover { background: var(--primary-bg); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ================================================================
   ORDER DETAIL PAGE
   ================================================================ */
.order-detail-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.detail-order-number { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.detail-status { padding: 4px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.detail-status.paid { background: #d1fae5; color: #065f46; }
.detail-status.refunded { background: #fee2e2; color: #991b1b; }
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.detail-info-item { font-size: 14px; }
.detail-info-label { color: var(--text-light); font-size: 12px; }
.detail-items { margin-bottom: 20px; }
.detail-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.detail-items-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-light);
  font-weight: 600;
  font-size: 13px;
}
.detail-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.detail-summary {
  border-top: 2px solid var(--primary-bg);
  padding-top: 16px;
  text-align: right;
}

/* ================================================================
   PRODUCTS MANAGEMENT PAGE
   ================================================================ */
.products-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.products-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.product-manage-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.product-manage-card:hover { box-shadow: var(--shadow-md); }
.product-manage-emoji { font-size: 40px; width: 56px; text-align: center; }
.product-manage-info { flex: 1; }
.product-manage-name { font-weight: 600; font-size: 15px; }
.product-manage-cat { font-size: 12px; color: var(--text-light); background: var(--bg); padding: 1px 8px; border-radius: 10px; display: inline-block; }
.product-manage-price { font-size: 16px; font-weight: 700; color: var(--accent); margin-top: 4px; }
.product-manage-meta { font-size: 12px; color: var(--text-light); }
.product-manage-actions { display: flex; flex-direction: column; gap: 6px; }
.btn-edit, .btn-delete {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}
.btn-edit { background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary); }
.btn-edit:hover { background: var(--primary); color: white; }
.btn-delete { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
.btn-delete:hover { background: var(--danger); color: white; }

/* ================================================================
   REPORT PAGE
   ================================================================ */
.report-content { display: flex; flex-direction: column; gap: 20px; }

.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.report-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 3px solid var(--primary);
}
.report-card.amber { border-top-color: var(--accent); }
.report-card.green { border-top-color: var(--success); }
.report-card.red { border-top-color: var(--danger); }
.report-card-value { font-size: 28px; font-weight: 700; color: var(--text); }
.report-card-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.report-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.report-section h3 {
  font-size: 16px;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* --- Bar Chart --- */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 8px; }
.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-value { font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.bar {
  width: 100%;
  max-width: 60px;
  background: linear-gradient(to top, var(--primary), var(--primary-light));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
  position: relative;
}
.bar-label { font-size: 10px; color: var(--text-light); margin-top: 6px; text-align: center; }

/* --- Top Products --- */
.top-products { display: flex; flex-direction: column; gap: 8px; }
.top-product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
}
.top-product-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.top-product-rank.gold { background: var(--accent); }
.top-product-rank.silver { background: var(--text-lighter); }
.top-product-rank.bronze { background: #cd853f; }
.top-product-name { flex: 1; font-weight: 500; font-size: 14px; }
.top-product-sales { font-weight: 700; color: var(--accent); font-size: 14px; }

/* --- Hourly Distribution --- */
.hourly-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
}
.hourly-item {
  text-align: center;
  padding: 4px 2px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--primary-bg);
  transition: var(--transition);
}
.hourly-item strong { display: block; font-size: 12px; }

.report-side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* --- Payment Breakdown --- */
.payment-breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.payment-breakdown-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.pb-icon { font-size: 28px; margin-bottom: 6px; }
.pb-name { font-size: 13px; color: var(--text-light); }
.pb-amount { font-size: 18px; font-weight: 700; color: var(--primary); }
.pb-count { font-size: 12px; color: var(--text-lighter); }

/* ================================================================
   SETTLEMENT PAGE
   ================================================================ */
.settlement-content { display: flex; flex-direction: column; gap: 20px; }
.settlement-summary {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.settlement-summary h3 { font-size: 16px; color: var(--primary-dark); margin-bottom: 14px; }
.settlement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.settlement-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.settlement-item.header { background: var(--primary-bg); }
.si-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.si-value { font-size: 20px; font-weight: 700; }
.si-value.positive { color: var(--success); }
.si-value.negative { color: var(--danger); }
.si-value.neutral { color: var(--primary); }

.discrepancy-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: 12px 16px;
  color: #92400e;
  font-weight: 600;
  text-align: center;
}
.discrepancy-ok {
  background: #d1fae5;
  border: 1px solid #10b981;
  border-radius: var(--radius);
  padding: 12px 16px;
  color: #065f46;
  font-weight: 600;
  text-align: center;
}

.settlement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.settlement-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-light);
  font-weight: 600;
  font-size: 13px;
}
.settlement-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.settlement-table tr:last-child { font-weight: 700; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalSlide 0.3s ease;
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.modal-header h2 { font-size: 18px; color: var(--primary-dark); }
.modal-success { background: #d1fae5; }
.modal-check { font-size: 48px; display: block; margin-bottom: 8px; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* --- Receipt --- */
.receipt-body {
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
}
.receipt-line { padding: 2px 0; }
.receipt-divider { border-top: 1px dashed #999; margin: 8px 0; }
.receipt-center { text-align: center; }
.receipt-right { text-align: right; }

/* --- Form --- */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.form-input, .form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,0.1); }

/* ================================================================
   RESPONSIVE - Mobile
   ================================================================ */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 8px;
  }
  .nav-links.open { display: flex; }
  .nav-link { border-radius: 0; padding: 12px 16px; }
  .mobile-menu-btn { display: block; }

  .cashier-layout { flex-direction: column; height: auto; }
  .cashier-products { border-right: none; border-bottom: 1px solid var(--border); max-height: 50vh; }
  .cashier-cart { width: 100%; max-height: none; }

  .products-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

  .page-topbar { flex-direction: column; align-items: flex-start; }
  .order-filters, .products-actions { width: 100%; }
  .filter-input, .filter-select { width: 100% !important; }

  .products-manage-grid { grid-template-columns: 1fr; }
  .report-cards { grid-template-columns: repeat(2, 1fr); }
  .hourly-grid { grid-template-columns: repeat(6, 1fr); }
  .settlement-grid { grid-template-columns: repeat(2, 1fr); }
  .payment-methods { grid-template-columns: repeat(2, 1fr); }

  .report-side-by-side { grid-template-columns: 1fr !important; }
  .bar-chart { height: 140px; }
  .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
}
