:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --ink: #18221d;
  --muted: #66706a;
  --line: #dce4dd;
  --accent: #087f5b;
  --accent-2: #d9480f;
  --soft: #e9f7f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: #12372a;
  color: #fff;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  font-size: 20px;
}

.topbar nav {
  display: flex;
  gap: 8px;
}

.topbar nav a,
.button {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255,255,255,.12);
}

.page {
  padding: 22px;
}

.login-panel {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: center;
  max-width: 980px;
  margin: auto;
}

.login-panel h1 {
  font-size: 46px;
  margin: 0 0 8px;
}

.card,
.cart-panel,
.menu-panel,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(25, 38, 31, .06);
}

.form-card,
.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

button,
.primary,
.ghost {
  border: 0;
  border-radius: 6px;
  padding: 10px 13px;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ghost {
  background: #edf1ee;
  color: var(--ink);
}

.full {
  width: 100%;
}

.alert {
  padding: 10px 12px;
  background: #fff1f0;
  color: #b42318;
  border-radius: 6px;
}

.notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #e9f7f1;
  color: #0b513d;
  border: 1px solid #b7e4d0;
  border-radius: 6px;
}

.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

.menu-panel,
.cart-panel,
.card {
  padding: 18px;
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.panel-head h1,
.cart-panel h2,
.dashboard h1 {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 0;
}

.tab {
  white-space: nowrap;
  background: #e8eee9;
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.product-card h3 {
  min-height: 42px;
  margin: 0 0 12px;
  font-size: 16px;
}

.size-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.size-row button,
.product-card .wide {
  background: var(--soft);
  color: #0b513d;
}

.cart-items {
  display: grid;
  gap: 10px;
  min-height: 130px;
  margin: 14px 0;
}

.cart-items.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cart-line span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.qty {
  display: grid;
  grid-template-columns: 32px 28px 32px;
  align-items: center;
  text-align: center;
}

.qty button,
.remove {
  background: #eef3ef;
}

.remove {
  color: var(--accent-2);
}

.totals {
  display: grid;
  gap: 10px;
}

.summary,
.receipt-total {
  display: grid;
  gap: 8px;
}

.summary div,
.receipt-total div {
  display: flex;
  justify-content: space-between;
}

.summary dd,
.receipt-total dd {
  margin: 0;
  font-weight: 800;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: auto;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: middle;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  margin-bottom: 18px;
}

.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.form-actions,
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.row-actions form {
  margin: 0;
}

.mini-button,
.button.light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: #eef3ef;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.mini-button.danger {
  background: #fff1f0;
  color: #b42318;
}

.receipt-wrap {
  display: grid;
  justify-content: center;
  gap: 16px;
}

.receipt {
  width: 340px;
  background: #fff;
  color: #111;
  padding: 18px;
  border: 1px solid var(--line);
}

.receipt h1,
.receipt p {
  text-align: center;
}

.receipt table {
  width: 100%;
  border-collapse: collapse;
}

.receipt th,
.receipt td {
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

@media print {
  .topbar,
  .actions {
    display: none;
  }

  .page {
    padding: 0;
  }

  .receipt {
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .pos-shell,
  .login-panel,
  .admin-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .topbar nav {
    flex-wrap: wrap;
  }

  .page {
    padding: 12px;
  }

  .panel-head {
    display: grid;
  }
}
