:root {
  color-scheme: light;
  --bg: #eef2f0;
  --surface: #ffffff;
  --ink: #17211d;
  --muted: #68756f;
  --line: #dde5e1;
  --green: #16734f;
  --green-dark: #0f563b;
  --amber: #f1b338;
  --red: #c04438;
  --blue: #2d6cdf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 20px;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(28, 45, 38, 0.18);
}

.login-help {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(280px, 420px);
  gap: 32px;
  justify-content: center;
  align-items: start;
  padding: 28px;
}

.phone {
  width: 100%;
  min-height: calc(100vh - 56px);
  max-height: 900px;
  overflow: auto;
  background: #f8faf9;
  border: 1px solid #cad6d0;
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(28, 45, 38, 0.18);
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions select {
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 8px;
  font-weight: 700;
}

.eyebrow,
.topbar h1 {
  margin: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cart-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  font-size: 20px;
  line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.topbar h1 {
  font-size: 24px;
  letter-spacing: 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.summary-grid article,
.panel,
.product-card,
.reorder-card,
.checkout,
.boss-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-grid article {
  padding: 14px;
}

.summary-grid span,
.cart-item span,
.product-card p,
.reorder-card p,
.boss-hero span,
.boss-hero p {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.summary-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 21px;
}

.tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.tab,
.filter-row button,
.segmented button,
.pay-methods button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 13px;
  white-space: nowrap;
}

.tab.active,
.filter-row .active,
.segmented .active,
.pay-methods .selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.page {
  display: none;
  padding-bottom: 18px;
}

.page.active {
  display: block;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.action-grid button {
  min-height: 78px;
  border: 0;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 10px;
  line-height: 1.2;
}

.panel,
.checkout,
.product-card,
.reorder-card,
.boss-hero {
  padding: 14px;
  margin-bottom: 12px;
}

.panel-title,
.cart-item,
.product-card,
.reorder-card,
.money-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title h2,
.product-card h3,
.reorder-card h3 {
  margin: 0;
  font-size: 17px;
}

.empty-state {
  border: 1px dashed #9db0a8;
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.clean-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.badge {
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.badge.danger {
  background: #ffe9e6;
  color: var(--red);
}

.badge.ok {
  background: #e8f5ef;
  color: var(--green);
}

.badge.muted {
  background: #eef1ef;
  color: var(--muted);
}

.negative {
  color: var(--red);
}

.search-box {
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px dashed #9db0a8;
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  margin-bottom: 12px;
}

.cart-item {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.cart-item:first-of-type {
  border-top: 0;
}

.stepper {
  display: grid;
  grid-template-columns: 34px 28px 34px;
  align-items: center;
  text-align: center;
}

.stepper button {
  height: 34px;
  border: 1px solid var(--line);
  background: #f5f8f6;
  border-radius: 8px;
}

.checkout {
  position: sticky;
  bottom: 0;
  box-shadow: 0 -10px 24px rgba(30, 48, 40, 0.08);
}

.checkout > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  margin-bottom: 12px;
}

.pay-methods,
.filter-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.primary {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.danger-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.small-button {
  min-height: 34px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #e8f5ef;
  color: var(--green-dark);
  font-weight: 700;
  padding: 0 10px;
}

.small-button.wide {
  width: 100%;
  margin: 0 0 12px;
}

.staff-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.staff-card strong,
.staff-card span {
  display: block;
}

.staff-card span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.staff-card .badge {
  color: var(--green);
  margin-top: 0;
}

.staff-card .badge.muted {
  color: var(--muted);
}

.permission-grid {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px 12px;
  padding-top: 10px;
}

.permission-grid span {
  color: var(--muted);
}

.form-row {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-row input,
.form-row select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.money-line {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.money-line:first-child {
  border-top: 0;
}

.money-line.total {
  font-size: 18px;
}

.difference {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff3f1;
  margin-bottom: 12px;
  font-weight: 700;
}

.boss-hero {
  background: var(--green-dark);
  color: #fff;
}

.boss-hero span,
.boss-hero p {
  color: rgba(255, 255, 255, 0.78);
}

.boss-hero strong {
  display: block;
  font-size: 34px;
  margin: 8px 0;
}

.notes {
  align-self: start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  line-height: 1.65;
}

.notes h2 {
  margin-top: 0;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .phone {
    min-height: auto;
    border-radius: 18px;
  }

  .notes {
    display: none;
  }
}
