:root {
  --orange: #ff6733;
  --dark: #152033;
  --muted: #6f7786;
  --line: #e9ebef;
  --bg: #f6f7f9;
}
* {
  box-sizing: border-box;
}
body.locked > aside,
body.locked > main,
body.locked > dialog {
  display: none;
}
#loginScreen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: #fff7f2;
}
body.locked #loginScreen {
  display: grid;
}
#loginForm {
  width: min(410px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 20px 60px #15203318;
}
#loginForm img {
  display: block;
  width: 170px;
  height: 78px;
  object-fit: cover;
  margin: 0 auto 18px;
}
#loginForm h1,
#loginForm p {
  text-align: center;
}
#loginForm p {
  color: var(--muted);
}
#loginForm label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 13px;
}
#loginForm input {
  display: block;
  width: 100%;
  margin-top: 6px;
}
#loginForm button {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
}
#loginError {
  display: block;
  min-height: 18px;
  color: #d74738;
  text-align: center;
  margin-top: 12px;
}
.user small {
  display: block;
  color: var(--muted);
  text-transform: capitalize;
}
.logout {
  background: #fff0ea;
  color: var(--orange);
  padding: 8px 10px;
  border-radius: 7px;
}
body {
  margin: 0;
  font:
    14px Inter,
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--dark);
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.brand {
  padding: 18px 18px 12px;
  background: var(--orange);
  color: #fff;
}
.brand img {
  display: block;
  width: 150px;
  height: 74px;
  object-fit: cover;
  object-position: center;
  margin: auto;
}
.brand small {
  display: block;
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-top: 4px;
}
nav {
  padding: 14px 10px;
  display: grid;
  gap: 5px;
}
nav button {
  text-align: left;
  background: none;
  padding: 12px 14px;
  border-radius: 9px;
  color: #4b5361;
}
nav button.active,
nav button:hover:not(:disabled) {
  background: #fff0ea;
  color: var(--orange);
  font-weight: 700;
}
nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
nav i {
  float: right;
  font-size: 9px;
  background: #eee;
  padding: 2px 5px;
  border-radius: 5px;
}
aside footer {
  margin-top: auto;
  padding: 18px;
  color: #9298a3;
  font-size: 12px;
}
main {
  margin-left: 240px;
  min-height: 100vh;
}
header {
  height: 84px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
header h1 {
  margin: 0;
  font-size: 23px;
}
header p,
.panel p {
  margin: 4px 0 0;
  color: var(--muted);
}
.user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.user span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
}
#menuBtn {
  display: none;
  background: none;
  font-size: 22px;
}
.page {
  display: none;
  padding: 25px;
}
.page.active {
  display: block;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.cards article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
  box-shadow: 0 3px 12px #18263d0a;
}
.cards small {
  color: var(--muted);
  display: block;
}
.cards strong {
  display: block;
  font-size: 26px;
  margin-top: 8px;
}
.cards .warn strong,
.stock-low,
.low {
  color: #dd4735 !important;
}
.panel,
.catalog,
.cart {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 20px;
  box-shadow: 0 3px 12px #18263d0a;
}
.panel h2,
.cart h2 {
  margin: 0;
}
.quick {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.quick button,
.panel-head > button,
.modal-actions button,
.checkout,
.search button {
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
}
.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
}
.search {
  display: flex;
  gap: 8px;
}
.search input,
.filters input {
  flex: 1;
}
.search input,
input,
select {
  border: 1px solid #dfe2e7;
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  background: #fff;
}
.search input:focus,
input:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px #ff67331c;
}
.category-tabs {
  display: flex;
  gap: 7px;
  overflow: auto;
  padding: 14px 0;
}
.category-tabs button {
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 20px;
  background: #f0f1f3;
  color: #596170;
}
.category-tabs button.active {
  background: var(--orange);
  color: #fff;
}
.category-tabs small {
  opacity: 0.75;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 600px;
  overflow: auto;
}
.product {
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.product:hover {
  border-color: var(--orange);
  box-shadow: 0 5px 15px #ff67331a;
}
.product span,
.pill {
  font-size: 10px;
  color: var(--orange);
  background: #fff0ea;
  padding: 3px 6px;
  border-radius: 9px;
  width: max-content;
}
.product small,
.cart-row small,
td small {
  color: var(--muted);
  display: block;
}
.product em {
  font-style: normal;
  font-weight: 800;
  color: var(--orange);
  font-size: 16px;
}
.cart h2 {
  display: flex;
  justify-content: space-between;
}
.link {
  background: none;
  color: var(--orange);
}
.cart-items {
  min-height: 180px;
  max-height: 330px;
  overflow: auto;
  margin: 15px 0;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 35px;
}
.cart-row {
  display: grid;
  grid-template-columns: 1fr 55px 75px 26px;
  align-items: center;
  gap: 7px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row input {
  width: 55px;
  padding: 7px;
}
.cart-row button {
  background: #fff0ea;
  color: #dd4735;
  border-radius: 50%;
  width: 25px;
  height: 25px;
}
.totals {
  display: grid;
  gap: 9px;
  border-top: 1px dashed #ccd0d7;
  padding-top: 14px;
}
.totals label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.totals label input {
  width: 130px;
}
.totals .grand {
  font-size: 19px;
}
.checkout {
  margin-top: 5px;
  padding: 14px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.filters select {
  min-width: 220px;
}
.category-summary {
  display: flex;
  gap: 9px;
  overflow: auto;
  padding: 3px 0 14px;
}
.category-summary button {
  min-width: 145px;
  text-align: left;
  padding: 10px;
  border-radius: 9px;
  background: #fafafa;
  border: 1px solid var(--line);
}
.category-summary span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  background: #fafafa;
}
.mini {
  background: #fff0ea;
  color: var(--orange);
  padding: 6px 9px;
  border-radius: 6px;
}
.secondary {
  background: #eef0f3 !important;
  color: #384150 !important;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 20px 80px #10182855;
  width: min(760px, 94vw);
}
dialog::backdrop {
  background: #15203380;
}
dialog form {
  padding: 20px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.modal-head h2 {
  margin: 0;
}
.modal-head button {
  font-size: 24px;
  background: none;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}
.form-grid label {
  font-size: 12px;
  color: var(--muted);
}
.form-grid input,
.form-grid select {
  display: block;
  width: 100%;
  margin-top: 5px;
  color: var(--dark);
}
.form-grid .wide {
  grid-column: 1/-1;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 17px;
}
.invoice {
  width: 80mm;
  margin: auto;
  padding: 8mm 5mm;
  color: #111;
  font: 12px Arial;
  background: #fff;
}
.invoice-logo {
  text-align: center;
}
.invoice-logo img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}
.invoice-logo h2 {
  margin: 3px;
}
.invoice > p {
  text-align: center;
  line-height: 1.45;
}
.invoice hr {
  border: 0;
  border-top: 1px dashed #333;
}
.invoice-meta {
  display: grid;
  gap: 3px;
}
.invoice table {
  white-space: normal;
}
.invoice th,
.invoice td {
  padding: 6px 2px;
  font-size: 11px;
}
.invoice-total {
  margin-left: auto;
  width: 65%;
  display: grid;
  gap: 4px;
}
.invoice-total span {
  display: flex;
  justify-content: space-between;
}
.invoice-total .grand {
  font-size: 15px;
  border-top: 1px solid;
  padding-top: 4px;
}
.thanks {
  font-size: 12px;
}
.thanks small {
  color: #555;
}
#invoiceDialog {
  width: auto;
}
#invoiceDialog > .modal-actions {
  padding: 12px;
  background: #f7f7f7;
}
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #1b9b5f;
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  transform: translateY(80px);
  opacity: 0;
  transition: 0.25s;
  z-index: 99;
}
#toast.show {
  transform: none;
  opacity: 1;
}
#toast.bad {
  background: #d74738;
}
@media (max-width: 1000px) {
  .pos {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  aside {
    transform: translateX(-100%);
    transition: 0.25s;
  }
  .nav-open aside {
    transform: none;
  }
  main {
    margin: 0;
  }
  #menuBtn {
    display: block;
  }
  .page {
    padding: 14px;
  }
  header {
    padding: 12px 15px;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .cards article {
    padding: 14px;
  }
  .cards strong {
    font-size: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .filters {
    flex-direction: column;
  }
  .pos {
    display: block;
  }
  .cart {
    margin-top: 12px;
  }
}
@media print {
  body > * {
    display: none !important;
  }
  #invoiceDialog {
    display: block !important;
    position: static !important;
    width: 80mm !important;
    box-shadow: none !important;
  }
  #invoiceDialog .invoice {
    display: block !important;
  }
  .no-print {
    display: none !important;
  }
  @page {
    size: 80mm auto;
    margin: 0;
  }
}
