:root {
  --blue: #0955a5;
  --sky: #e9f7ff;
  --green: #4f8c39;
  --yellow: #ffd02f;
  --pink: #d93f83;
  --dark: #153247;
  --border: #dbe5ea;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  color: var(--dark);
  background: #f4f8fa;
}
.hidden {
  display: none !important;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  min-height: 46px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #dff5ff, #fff4c9);
}
.login-card {
  width: min(390px, 92vw);
  text-align: center;
  background: #fff;
  padding: 22px;
  border-radius: 28px;
  box-shadow: 0 20px 60px #0b4f8540;
}
.login-card img {
  width: 145px;
  height: 145px;
  object-fit: cover;
  border-radius: 50%;
}
.login-card h1 {
  font-size: 24px;
  margin: 8px 0;
}
.pin-dots {
  font-size: 28px;
  letter-spacing: 8px;
  margin: 18px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.keypad button {
  font-size: 22px;
  background: #edf6fb;
  height: 58px;
}
.keypad button:last-child {
  background: var(--blue);
  color: #fff;
}
.error {
  color: #b91c1c;
  min-height: 20px;
}
header {
  height: 72px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.brand small {
  display: block;
  color: #648;
}
.brand strong {
  display: block;
}
nav {
  display: flex;
  gap: 6px;
}
nav button {
  padding: 0 14px;
  background: #eef4f7;
}
nav button.active {
  background: var(--blue);
  color: #fff;
}
main {
  padding: 14px;
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  height: calc(100vh - 100px);
}
.catalog {
  overflow: auto;
}
.categories {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 12px;
}
.categories button {
  padding: 0 18px;
  color: #fff;
  white-space: nowrap;
}
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}
.product {
  min-height: 105px;
  padding: 12px;
  background: #fff;
  border: 3px solid var(--cat);
  box-shadow: 0 3px 10px #27415515;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.product strong {
  font-size: 17px;
}
.product span {
  font-size: 20px;
  color: var(--cat);
}
.cart,
.panel {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 18px #23435b12;
}
.cart {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cart h2 {
  margin: 0 0 10px;
}
.cart-items {
  overflow: auto;
  flex: 1;
}
.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row .controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.cart-row button {
  min-height: 34px;
  width: 34px;
  border-radius: 8px;
}
.cart-row small {
  display: block;
  color: #64748b;
}
.offered {
  color: var(--pink);
  font-weight: bold;
}
.cart-total {
  font-size: 22px;
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-top: 2px solid var(--dark);
}
.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cart-actions .primary {
  grid-column: 1/-1;
}
.primary {
  background: var(--blue);
  color: #fff;
  padding: 0 16px;
}
.secondary {
  background: #eaf1f5;
  color: var(--dark);
  padding: 0 14px;
}
.danger {
  background: #b42318;
  color: #fff;
  padding: 0 14px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
}
.tabs-grid,
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.tab-card,
.stat {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border-left: 7px solid var(--green);
  box-shadow: 0 3px 14px #1232;
}
.tab-card strong,
.stat strong {
  display: block;
  font-size: 25px;
  margin-top: 8px;
}
.admin-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 14px;
}
.panel h2,
.panel h3 {
  margin-top: 0;
}
form {
  display: grid;
  gap: 9px;
}
input,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd8df;
  border-radius: 10px;
  background: #fff;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 9px;
  border-bottom: 1px solid var(--border);
}
dialog {
  border: 0;
  border-radius: 20px;
  width: min(520px, 94vw);
  padding: 20px;
  box-shadow: 0 20px 80px #0005;
}
dialog::backdrop {
  background: #0d263c88;
}
.close {
  float: right;
  background: #eee;
  font-size: 22px;
}
.pay-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pay-buttons button {
  height: 64px;
  background: #eaf2f7;
}
.muted {
  color: #789;
}
@media (max-width: 800px) {
  header {
    height: auto;
    align-items: flex-start;
  }
  .brand strong {
    font-size: 14px;
  }
  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 7px;
    z-index: 20;
    justify-content: space-around;
    border-top: 1px solid var(--border);
  }
  nav button {
    font-size: 12px;
    padding: 0 8px;
  }
  main {
    padding: 10px 10px 76px;
  }
  .pos-layout {
    display: block;
    height: auto;
  }
  .catalog {
    padding-bottom: 300px;
  }
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
  .product {
    min-height: 95px;
  }
  .cart {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 61px;
    z-index: 15;
    max-height: 270px;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px #0002;
  }
  .cart h2 {
    font-size: 16px;
  }
  .cart-items {
    max-height: 95px;
  }
  .cart-row {
    padding: 5px 0;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .section-head {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .brand img {
    width: 42px;
    height: 42px;
  }
}
