/* =========================
   RESET / BASE
========================= */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #fff;
  color: #000;
}

.hidden {
  display: none !important;
}

/* =========================
   TOPBAR
========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
}

.topbar input {
  height: 32px;
  padding: 4px 8px;
}

/* =========================
   CONTENT
========================= */
.content {
  padding: 16px;
}

/* =========================
   TABLE
========================= */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
  font-size: 14px;
}

.table th {
  font-weight: 600;
}

/* =========================
   BUTTONS
========================= */
button {
  padding: 6px 12px;
  cursor: pointer;
}

button.primary {
  font-weight: 600;
}

/* =========================
   BACKDROP
========================= */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
}

/* =========================
   DRAWER
========================= */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 420px;
  background: #fff;
  z-index: 110;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.drawer h2 {
  margin: 0 0 8px;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* =========================
   FORMS
========================= */
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

input, select {
  padding: 6px 8px;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* =========================
   ITEM ADD BAR
========================= */
.item-add {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.item-add input {
  flex: 1;
}

/* =========================
   MODAL
========================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  min-width: 360px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* =========================
   POS LAYOUT
========================= */
.pos {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

.scan-bar {
  padding: 8px 16px;
  border-bottom: 1px solid #ddd;
}

.scan-bar input {
  width: 100%;
  height: 36px;
  font-size: 16px;
  padding: 6px 10px;
}

.pos .content {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px;
}

.cart {
  flex: 2;
}

.summary {
  flex: 1;
  border-left: 1px solid #ddd;
  padding-left: 16px;
}

.summary .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.summary .row.input {
  align-items: center;
}

.summary .row.grand {
  font-weight: 700;
  margin-top: 8px;
}

.checkbox{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
/* =========================
   FOOTER KEYS
========================= */
.keys {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #ddd;
}

.keys button {
  height: 48px;
  font-size: 12px;
}


/* =========================
   TOPBAR (NAV LAYOUT FIX)
========================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;

  height: 56px;
  padding: 0 16px;

  display: flex;
  align-items: center;
  gap: 24px;

  background: #fff;
  border-bottom: 1px solid #ddd;
}

/* BRAND */
.topbar .brand {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* NAV */
.topbar .nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* NAV LINKS */
.topbar .nav a {
  text-decoration: none;
  font-size: 14px;
  color: inherit;
  opacity: 0.7;
  padding: 4px 0;
}

/* ACTIVE PAGE */
.topbar .nav a.active {
  opacity: 1;
  font-weight: 600;
  border-bottom: 2px solid #000;
}



/* POS CONTENT FIX */
.pos .content {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

/* FORCE CART TO USE AVAILABLE SPACE */
.pos .cart {
  flex: 1;
  min-width: 0; /* IMPORTANT */
}

/* FORCE TABLE TO FILL CART */
.pos .cart table {
  width: 100%;
}


/* =========================
   LOOKUP / SEARCH RESULTS
========================= */

/* Make lookup rows feel clickable */
#lookupResults > div,
#product-results tr {
  cursor: pointer;
}

/* Hover feedback */
#lookupResults > div:hover,
#product-results tr:hover {
  background: #f2f2f2;
}

/* Active click feedback */
#lookupResults > div:active,
#product-results tr:active {
  background: #e6e6e6;
}

.row-neg-stock {
  background: #ffecec;
  color: #b71c1c;
}
.row-neg-stock {
  background: red;
  color: white;
}

.row-zero-stock {
  background: yellow;
  color: black;
}
