/* ================================================================
   pos.css — AirCityShops POS Styles
   Covers: Terminal, Sales, Receipt, Reports, Customers, Inventory
   All pages are fully mobile-responsive
   ================================================================ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  --pos-bg:        #0b0e1a;
  --pos-surface:   #111827;
  --pos-card:      #1a2035;
  --pos-border:    rgba(255,255,255,0.07);
  --pos-accent:    #6366f1;
  --pos-accent-h:  #4f46e5;
  --pos-green:     #22c55e;
  --pos-green-h:   #16a34a;
  --pos-red:       #ef4444;
  --pos-yellow:    #f59e0b;
  --pos-text:      #e2e8f0;
  --pos-dim:       #64748b;
  --pos-secondary: #94a3b8;
  --pos-radius:    10px;
  --pos-radius-lg: 14px;
}

/* ================================================================
   SHARED PAGE LAYOUT
   ================================================================ */
.pos-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.pos-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pos-page-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--pos-text);
  margin: 0 0 4px;
}

.pos-page-header p {
  color: var(--pos-dim);
  font-size: 13px;
  margin: 0;
}

/* ── Sub-nav bar ─────────────────────────────────────────────── */
.pos-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pos-nav-links a {
  padding: 7px 15px;
  border-radius: 8px;
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  color: var(--pos-secondary);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.pos-nav-links a:hover,
.pos-nav-links a.active {
  background: var(--pos-accent);
  color: #fff;
  border-color: var(--pos-accent);
}

/* ── Cards ───────────────────────────────────────────────────── */
.pos-card {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 20px;
  margin-bottom: 18px;
}

.pos-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--pos-dim);
  margin: 0 0 14px;
}

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

.pos-stat-tile {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  padding: 16px;
}

.pos-stat-tile .v {
  font-size: 26px;
  font-weight: 800;
  color: var(--pos-text);
}

.pos-stat-tile .v.green  { color: var(--pos-green); }
.pos-stat-tile .v.red    { color: var(--pos-red); }
.pos-stat-tile .v.yellow { color: var(--pos-yellow); }
.pos-stat-tile .v.accent { color: var(--pos-accent); }

.pos-stat-tile .l {
  font-size: 11px;
  color: var(--pos-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Badges ──────────────────────────────────────────────────── */
.pos-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.pos-badge.completed { background: rgba(34,197,94,.15);  color: var(--pos-green); }
.pos-badge.voided    { background: rgba(239,68,68,.15);  color: var(--pos-red); }
.pos-badge.refunded  { background: rgba(245,158,11,.15); color: var(--pos-yellow); }

/* ── Tables ──────────────────────────────────────────────────── */
.pos-table-wrap {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

.pos-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.pos-table thead tr { background: var(--pos-bg); }

.pos-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--pos-dim);
}

.pos-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--pos-secondary);
  border-top: 1px solid rgba(255,255,255,.04);
}

.pos-table tbody tr:hover td { background: rgba(99,102,241,.04); }

.pos-table .ref    { font-weight: 700; color: #a5b4fc; font-family: monospace; }
.pos-table .amount { font-weight: 700; color: var(--pos-green); }

.pos-table .tbl-actions a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  color: var(--pos-secondary);
  text-decoration: none;
  margin-right: 4px;
  transition: background .13s, color .13s;
}

.pos-table .tbl-actions a:hover        { background: var(--pos-accent); color: #fff; border-color: var(--pos-accent); }
.pos-table .tbl-actions a.danger:hover { background: var(--pos-red);    color: #fff; border-color: var(--pos-red); }

/* ── Buttons ─────────────────────────────────────────────────── */
.pos-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: filter .15s, transform .1s;
}

.pos-btn:active { transform: scale(.97); }
.pos-btn:disabled { opacity: .5; cursor: not-allowed; }

.pos-btn-primary { background: var(--pos-accent);  color: #fff; }
.pos-btn-green   { background: var(--pos-green);   color: #fff; }
.pos-btn-danger  { background: transparent; color: var(--pos-red); border: 1px solid rgba(239,68,68,.35); }
.pos-btn-ghost   { background: transparent; color: var(--pos-secondary); border: 1px solid var(--pos-border); }
.pos-btn-full    { width: 100%; }
.pos-btn-lg      { padding: 14px 24px; font-size: 15px; border-radius: 10px; }

.pos-btn-primary:hover { filter: brightness(1.12); }
.pos-btn-green:hover   { background: var(--pos-green-h); }

/* ── Forms / Inputs ──────────────────────────────────────────── */
.pos-input,
.pos-select {
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--pos-text);
  font-size: 14px;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}

.pos-input::placeholder { color: var(--pos-dim); }
.pos-input:focus,
.pos-select:focus { outline: none; border-color: var(--pos-accent); }

.pos-select { cursor: pointer; }

/* ── Empty state ─────────────────────────────────────────────── */
.pos-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--pos-dim);
}

.pos-empty .icon  { font-size: 40px; margin-bottom: 12px; }
.pos-empty p      { font-size: 14px; margin: 4px 0; }
.pos-empty a      { color: var(--pos-accent); text-decoration: none; }

/* ── Pagination ──────────────────────────────────────────────── */
.pos-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pos-pagination a,
.pos-pagination span {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  color: var(--pos-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: background .13s;
}

.pos-pagination .pg-active,
.pos-pagination a:hover {
  background: var(--pos-accent);
  color: #fff;
  border-color: var(--pos-accent);
}

/* ================================================================
   POS TERMINAL — DESKTOP (default: side-by-side)
   ================================================================ */
.pos-terminal-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 64px);
  background: var(--pos-bg);
  overflow: hidden;
}

/* ── Left panel: products ────────────────────────────────────── */
.pos-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--pos-border);
}

.pos-toolbar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--pos-surface);
  border-bottom: 1px solid var(--pos-border);
  align-items: center;
  flex-wrap: wrap;
}

.pos-toolbar h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-accent);
  margin: 0;
  white-space: nowrap;
}

.pos-toolbar-links {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.pos-toolbar-links a {
  font-size: 12px;
  color: var(--pos-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color .13s;
}

.pos-toolbar-links a:hover { color: var(--pos-accent); }

/* ── Category tabs ───────────────────────────────────────────── */
.pos-cat-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  background: var(--pos-surface);
  border-bottom: 1px solid var(--pos-border);
  flex-shrink: 0;
  scrollbar-width: none;
}

.pos-cat-tabs::-webkit-scrollbar { display: none; }

.pos-cat-tab {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid var(--pos-border);
  background: transparent;
  color: var(--pos-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.pos-cat-tab.active,
.pos-cat-tab:hover {
  background: var(--pos-accent);
  color: #fff;
  border-color: var(--pos-accent);
}

/* ── Product grid ────────────────────────────────────────────── */
.pos-products-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.pos-product-card {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  position: relative;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  border-color: var(--pos-accent);
  box-shadow: 0 4px 16px rgba(99,102,241,.2);
}

.pos-product-card:active { transform: scale(.95); }

.pos-product-card.out-of-stock {
  opacity: .4;
  pointer-events: none;
}

.pos-product-card.low-stock { border-color: var(--pos-yellow); }

/* flash animation on add */
.pos-product-card.flash {
  animation: cardFlash .25s ease;
}

@keyframes cardFlash {
  0%   { transform: scale(1); }
  50%  { transform: scale(.92); background: rgba(99,102,241,.25); }
  100% { transform: scale(1); }
}

.pos-product-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
  background: var(--pos-bg);
}

.pos-product-name  { font-size: 12px; font-weight: 600; color: var(--pos-text); line-height: 1.3; margin-bottom: 4px; }
.pos-product-price { font-size: 13px; font-weight: 700; color: var(--pos-green); }
.pos-product-stock { font-size: 10px; color: var(--pos-dim); margin-top: 2px; }
.pos-product-stock.warn { color: var(--pos-yellow); }

.pos-no-results {
  color: var(--pos-dim);
  text-align: center;
  padding: 28px;
  font-size: 14px;
  grid-column: 1/-1;
}

/* ── Right panel: order ──────────────────────────────────────── */
.pos-right {
  display: flex;
  flex-direction: column;
  background: var(--pos-surface);
  overflow: hidden;
}

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

.pos-order-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-text);
  margin: 0;
}

/* ── Customer row ────────────────────────────────────────────── */
.pos-customer-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--pos-border);
}

.pos-customer-select {
  flex: 1;
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--pos-text);
  font-size: 13px;
}

.pos-customer-select:focus { outline: none; border-color: var(--pos-accent); }

/* ── Cart items ──────────────────────────────────────────────── */
.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.pos-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--pos-dim);
  font-size: 14px;
  gap: 8px;
  text-align: center;
}

.pos-cart-empty .icon { font-size: 34px; }

.pos-cart-item {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  animation: slideIn .15s ease;
}

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

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

.pos-cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--pos-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-cart-item-unit { font-size: 11px; color: var(--pos-dim); margin-top: 2px; }

.pos-cart-qty-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.pos-qty-btn {
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 4px;
  color: var(--pos-text);
  width: 26px;
  height: 26px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}

.pos-qty-btn:hover { background: var(--pos-accent); border-color: var(--pos-accent); }

.pos-qty-input {
  width: 44px;
  text-align: center;
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 4px;
  color: var(--pos-text);
  font-size: 13px;
  padding: 2px 4px;
}

.pos-cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.pos-cart-item-total { font-size: 14px; font-weight: 700; color: var(--pos-green); white-space: nowrap; }

.pos-remove-btn {
  background: transparent;
  border: none;
  color: var(--pos-red);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: background .12s;
}

.pos-remove-btn:hover { background: rgba(239,68,68,.15); }

/* ── Totals panel ────────────────────────────────────────────── */
.pos-totals {
  padding: 10px 14px;
  border-top: 1px solid var(--pos-border);
  background: var(--pos-bg);
}

.pos-discount-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.pos-discount-row select { width: 130px; flex-shrink: 0; }
.pos-discount-row input  { flex: 1; }

.pos-discount-row select,
.pos-discount-row input {
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 6px;
  color: var(--pos-text);
  padding: 5px 8px;
  font-size: 12px;
}

.pos-tax-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--pos-dim);
}

.pos-tax-row input {
  width: 70px;
  background: var(--pos-card);
  border: 1px solid var(--pos-border);
  border-radius: 6px;
  color: var(--pos-text);
  padding: 5px 8px;
  font-size: 12px;
}

.pos-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--pos-dim);
  margin-bottom: 4px;
}

.pos-totals-row.total-line {
  font-size: 18px;
  font-weight: 800;
  color: var(--pos-text);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--pos-border);
}

.pos-totals-row.total-line span:last-child { color: var(--pos-green); }

/* ── Payment section ─────────────────────────────────────────── */
.pos-payment-section {
  padding: 10px 14px 12px;
  background: var(--pos-surface);
  border-top: 1px solid var(--pos-border);
}

.pos-payment-methods {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}

.pos-pay-method {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid var(--pos-border);
  border-radius: 7px;
  background: var(--pos-bg);
  color: var(--pos-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .13s, color .13s, border-color .13s;
}

.pos-pay-method.active {
  background: var(--pos-accent);
  border-color: var(--pos-accent);
  color: #fff;
}

.pos-cash-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--pos-dim);
}

.pos-cash-row input {
  flex: 1;
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 6px;
  color: var(--pos-text);
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 600;
}

.pos-change-display {
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: 8px;
  padding: 7px 12px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pos-green);
}

.pos-charge-btn {
  width: 100%;
  padding: 14px;
  background: var(--pos-green);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .03em;
  transition: background .15s, transform .1s;
}

.pos-charge-btn:hover   { background: var(--pos-green-h); }
.pos-charge-btn:active  { transform: scale(.98); }
.pos-charge-btn:disabled { background: var(--pos-dim); cursor: not-allowed; }

/* ── Modal overlay ───────────────────────────────────────────── */
.pos-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pos-modal-overlay.show { display: flex; }

.pos-modal {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: 16px;
  padding: 30px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: modalPop .2s ease;
}

@keyframes modalPop {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.pos-modal .modal-icon { font-size: 48px; margin-bottom: 12px; }
.pos-modal h3          { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.pos-modal p           { color: var(--pos-dim); font-size: 14px; margin-bottom: 14px; }
.pos-modal-ref         { font-size: 18px; font-weight: 700; color: var(--pos-text); margin-bottom: 20px; font-family: monospace; }

.pos-modal-actions { display: flex; gap: 10px; }

.pos-modal-actions a,
.pos-modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: filter .13s;
}

.pos-modal-actions a:hover,
.pos-modal-actions button:hover { filter: brightness(1.1); }

.modal-btn-receipt { background: var(--pos-accent); color: #fff; border: none; }
.modal-btn-new     { background: transparent; color: var(--pos-text); border: 1px solid var(--pos-border); }

/* ── Mobile tab toggle (shows/hides panels on small screens) ─── */
.pos-mobile-tabs {
  display: none;
  border-bottom: 1px solid var(--pos-border);
  background: var(--pos-surface);
}

.pos-mobile-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--pos-dim);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color .13s, border-color .13s;
}

.pos-mobile-tab.active {
  color: var(--pos-accent);
  border-bottom-color: var(--pos-accent);
}

/* ── Reports ─────────────────────────────────────────────────── */
.date-filter {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.date-filter label { font-size: 13px; color: var(--pos-dim); white-space: nowrap; }

.date-filter input {
  background: var(--pos-bg);
  border: 1px solid var(--pos-border);
  border-radius: 7px;
  color: var(--pos-text);
  padding: 7px 12px;
  font-size: 13px;
}

.date-filter input:focus { outline: none; border-color: var(--pos-accent); }

.date-filter .quick-links { display: flex; gap: 8px; flex-wrap: wrap; }
.date-filter .quick-links a {
  font-size: 12px;
  color: var(--pos-dim);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--pos-border);
  transition: background .13s, color .13s;
}
.date-filter .quick-links a:hover { background: var(--pos-accent); color: #fff; border-color: var(--pos-accent); }

.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* Bar chart bars */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }

.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 11px; color: var(--pos-dim); width: 60px; flex-shrink: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: rgba(255,255,255,.05); border-radius: 4px; height: 18px; overflow: hidden; }
.bar-fill  { height: 100%; background: var(--pos-accent); border-radius: 4px; transition: width .4s ease; min-width: 2px; }
.bar-value { font-size: 11px; color: #a5b4fc; width: 70px; flex-shrink: 0; }

/* Summary chips */
.summary-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.summary-chip {
  background: var(--pos-surface);
  border: 1px solid var(--pos-border);
  border-radius: var(--pos-radius);
  padding: 14px 18px;
  flex: 1;
  min-width: 140px;
}

.summary-chip .v { font-size: 22px; font-weight: 800; color: var(--pos-text); }
.summary-chip .v.green { color: var(--pos-green); }
.summary-chip .l { font-size: 11px; color: var(--pos-dim); margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }

/* Daily table in reports */
.daily-table { width: 100%; border-collapse: collapse; }
.daily-table th { font-size: 10px; color: var(--pos-dim); text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.06); text-transform: uppercase; }
.daily-table td { font-size: 12px; color: var(--pos-secondary); padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.04); }
.daily-table td:last-child { text-align: right; color: var(--pos-green); font-weight: 700; }

/* Payment chips */
.payment-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.payment-chip  { display: inline-flex; gap: 6px; align-items: center; background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.25); border-radius: 20px; padding: 5px 14px; font-size: 12px; color: #a5b4fc; }
.payment-chip strong { color: var(--pos-text); }

/* Low stock alert in dashboard/hub */
.low-stock-alert {
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--pos-radius);
  padding: 14px 16px;
  margin-top: 14px;
}

.low-stock-alert h4 {
  color: var(--pos-yellow);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 8px;
}

.low-stock-items { display: flex; flex-wrap: wrap; gap: 8px; }

.low-stock-chip {
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: #fbbf24;
}

/* ================================================================
   RECEIPT  (print-friendly)
   ================================================================ */
.receipt-page   { max-width: 480px; margin: 30px auto; padding: 16px; }

.receipt-wrap {
  background: var(--pos-surface);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 28px 24px;
  font-family: 'Courier New', monospace;
}

.receipt-logo   { text-align: center; font-size: 20px; font-weight: 800; color: var(--pos-text); margin-bottom: 4px; }
.receipt-store  { text-align: center; font-size: 13px; color: var(--pos-dim); margin-bottom: 14px; }
.receipt-divider{ border-top: 1px dashed rgba(255,255,255,.15); margin: 12px 0; }
.receipt-ref    { text-align: center; font-size: 12px; color: #a5b4fc; margin-bottom: 6px; }
.receipt-date   { text-align: center; font-size: 11px; color: var(--pos-dim); margin-bottom: 14px; }

.receipt-items table { width: 100%; border-collapse: collapse; }
.receipt-items th    { font-size: 10px; color: var(--pos-dim); text-align: left; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.receipt-items td    { font-size: 12px; color: var(--pos-secondary); padding: 6px 0; }
.receipt-items td:last-child { text-align: right; }

.receipt-totals-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--pos-secondary); margin-bottom: 4px; }
.receipt-totals-row.total-line { font-size: 15px; font-weight: 800; color: var(--pos-text); border-top: 1px dashed rgba(255,255,255,.15); padding-top: 8px; margin-top: 6px; }
.receipt-totals-row.total-line span:last-child { color: var(--pos-green); }
.receipt-change { background: rgba(34,197,94,.1); border-radius: 8px; padding: 8px 12px; display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--pos-green); }
.receipt-footer { text-align: center; margin-top: 16px; font-size: 11px; color: var(--pos-dim); }

.receipt-actions  { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.receipt-actions a,
.receipt-actions button {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-print { background: var(--pos-accent); color: #fff; border: none; }
.btn-back  { background: transparent; color: var(--pos-secondary); border: 1px solid var(--pos-border); }

/* ================================================================
   INVENTORY
   ================================================================ */
.inv-summary-chips { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.inv-chip { background: var(--pos-surface); border: 1px solid var(--pos-border); border-radius: 10px; padding: 14px 18px; }
.inv-chip .v { font-size: 20px; font-weight: 800; color: var(--pos-text); }
.inv-chip .l { font-size: 11px; color: var(--pos-dim); margin-top: 2px; }

/* ================================================================
   RESPONSIVE — TABLET  ≤ 900px
   ================================================================ */
@media (max-width: 900px) {
  .reports-grid { grid-template-columns: 1fr; }
  .pos-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   RESPONSIVE — MOBILE  ≤ 680px
   ================================================================ */
@media (max-width: 680px) {

  /* Terminal switches from side-by-side to tab-based stacked layout */
  .pos-terminal-wrap {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 64px);
    overflow: visible;
  }

  /* Show mobile tabs */
  .pos-mobile-tabs { display: flex; }

  /* Both panels fill full width; toggled by JS */
  .pos-left,
  .pos-right {
    width: 100%;
    border-right: none;
    overflow: visible;
  }

  .pos-left { border-bottom: 1px solid var(--pos-border); }

  /* Hide inactive panel on mobile */
  .pos-left.mobile-hidden,
  .pos-right.mobile-hidden {
    display: none;
  }

  /* Product grid: 2 columns on mobile */
  .pos-products-grid { grid-template-columns: repeat(2, 1fr); }

  /* Cart items: smaller */
  .pos-cart-item  { padding: 8px; }
  .pos-cart-item-name { font-size: 12px; }
  .pos-cart-item-total { font-size: 13px; }

  /* Totals: compact */
  .pos-totals { padding: 8px 12px; }
  .pos-totals-row.total-line { font-size: 16px; }

  /* Payment methods: 2 per row */
  .pos-payment-methods { flex-wrap: wrap; }
  .pos-pay-method { min-width: calc(50% - 4px); }

  /* Charge button */
  .pos-charge-btn { font-size: 14px; padding: 12px; }

  /* Page headers */
  .pos-page-header { flex-direction: column; gap: 12px; }
  .pos-page-header h2 { font-size: 18px; }

  .pos-nav-links a { padding: 6px 12px; font-size: 12px; }

  /* Tables: scroll horizontally */
  .pos-table { font-size: 12px; }
  .pos-table th, .pos-table td { padding: 10px 10px; }

  /* Date filter stack */
  .date-filter { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Stats row: full-width tiles */
  .pos-stats-row { grid-template-columns: repeat(2, 1fr); }

  /* Summary chips */
  .summary-chip { min-width: calc(50% - 8px); }
  .summary-chip .v { font-size: 18px; }

  /* Reports grid */
  .reports-grid { grid-template-columns: 1fr; }

  /* Inventory chips */
  .inv-summary-chips { gap: 8px; }
  .inv-chip { flex: 1; min-width: calc(50% - 6px); }

  /* Receipt */
  .receipt-page { padding: 10px; }
  .receipt-wrap { padding: 20px 16px; }
  .receipt-actions { gap: 8px; }

  /* Modal */
  .pos-modal { padding: 24px 18px; }
  .pos-modal h3 { font-size: 18px; }
  .pos-modal-ref { font-size: 16px; }
}

@media (max-width: 380px) {
  .pos-products-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-product-img   { width: 48px; height: 48px; }
  .pos-product-name  { font-size: 11px; }
}

/* ================================================================
   PRINT (receipt page only)
   ================================================================ */
@media print {
  .main-header,
  .main-footer,
  .receipt-actions,
  .pos-nav-links { display: none !important; }

  body { background: #fff !important; }

  .receipt-wrap {
    max-width: 320px;
    margin: 0 auto;
    box-shadow: none !important;
    border: none !important;
    background: #fff !important;
  }

  .receipt-wrap * { color: #000 !important; }
}
