:root {
  --bg: #f5f7f3;
  --paper: #ffffff;
  --panel: #ffffff;
  --ink: #17231b;
  --muted: #647067;
  --line: #d8dfd7;
  --brand: #0b6b2b;
  --brand-dark: #06451f;
  --brand-2: #c84a1b;
  --accent: #d8a21b;
  --danger: #b42318;
  --ok: #0d6f23;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 18px 48px rgba(16, 24, 20, .08);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, #f5f7f3 360px),
    var(--bg);
  color: var(--ink);
}

body.auth-mode {
  background:
    radial-gradient(circle at 12% 18%, rgba(11, 107, 43, .08), transparent 18rem),
    linear-gradient(180deg, #ffffff, #eef3ec);
}

body.auth-standalone {
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 12%, rgba(11, 107, 43, .10), transparent 22rem),
    linear-gradient(135deg, #f8faf7 0%, #eef3ec 48%, #e6eee4 100%);
}

body.auth-mode .topbar,
body.auth-mode .bottom-nav,
body.auth-mode .auth-panel {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 18px 18px 88px;
}

body.auth-mode .app-shell {
  width: min(1280px, 100%);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, .92fr) minmax(420px, 1fr);
  align-items: stretch;
}

.auth-product {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 34px;
  background: #0f2117;
  color: #fff;
  overflow: hidden;
}

.auth-product::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 33, 23, .12), rgba(15, 33, 23, .86)),
    url("/images/A.jpeg") center top / cover no-repeat;
  opacity: .82;
}

.auth-product::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 33, 23, .82), rgba(15, 33, 23, .22));
}

.auth-product > * {
  position: relative;
  z-index: 1;
}

.auth-product-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-product-top strong,
.auth-product-top span {
  display: block;
}

.auth-product-top strong {
  font-size: 1.18rem;
}

.auth-product-top span {
  color: rgba(255, 255, 255, .74);
  font-size: .82rem;
  font-weight: 700;
}

.auth-product-image {
  align-self: center;
  width: min(360px, 72%);
  aspect-ratio: 3 / 4;
  justify-self: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  background: url("/images/A.jpeg") center top / cover no-repeat;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.auth-product-copy {
  max-width: 620px;
}

.auth-product-copy h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.03;
}

.auth-product-copy p {
  max-width: 48ch;
  color: rgba(255, 255, 255, .78);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-card-pro {
  align-self: center;
  justify-self: center;
  width: min(480px, calc(100% - 48px));
  display: grid;
  gap: 20px;
  border: 1px solid #d8dfd7;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  padding: clamp(24px, 4vw, 38px);
  box-shadow: 0 24px 80px rgba(17, 31, 22, .14);
}

.auth-card-head {
  display: grid;
  gap: 6px;
}

.auth-card-head p {
  margin: 0;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.auth-card-head h2 {
  font-size: 1.8rem;
}

.auth-card-head span {
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.auth-footnote {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: .86rem;
}

.auth-footnote strong {
  color: var(--ink);
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: .86rem;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0 18px;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(216, 223, 215, .72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.brand strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.1;
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.top-logout {
  min-height: 42px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
}

.auth-panel {
  margin-bottom: 18px;
}

.auth-card,
.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-screen {
  width: min(1120px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, .86fr);
  overflow: hidden;
  border: 1px solid #d7ded5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(17, 31, 22, .14);
}

.login-art {
  position: relative;
  min-height: 680px;
  background:
    linear-gradient(180deg, rgba(6, 69, 31, .15), rgba(6, 69, 31, .74)),
    url("/images/A.jpeg") center top / cover no-repeat;
}

.login-art::after {
  content: "Client ordering and admin operations in one PWA";
  position: absolute;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: block;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 10px;
  background: rgba(6, 35, 18, .72);
  color: #fff;
  padding: 18px;
  font-weight: 800;
  line-height: 1.35;
  backdrop-filter: blur(12px);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(28px, 5vw, 56px);
  background: #fff;
}

.login-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-head h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: none;
  color: var(--ink);
}

.login-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6f2;
}

.segmented button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6b62;
  font-weight: 800;
}

.segmented button.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 2px rgba(16, 24, 20, .08);
}

.enterprise-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
}

.login-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.login-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.login-metric strong {
  display: block;
  color: var(--ink);
  font-size: 1.18rem;
}

.login-metric span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.login-note strong {
  color: var(--brand-dark);
}

.auth-card {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 16px;
  padding: 14px;
}

.auth-card.signed-in {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.auth-copy strong {
  display: block;
  margin-bottom: 4px;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.auth-form,
.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-grid {
  margin-top: 14px;
}

.address-list {
  display: grid;
  gap: 8px;
}

.address-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.address-card {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.address-card span,
.address-row p {
  margin: 0;
  font-size: .84rem;
}

.address-card.active,
.address-row.active {
  border-color: rgba(13, 111, 35, .45);
  background: rgba(13, 111, 35, .08);
}

.address-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

.checkbox-field {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-field input {
  width: auto;
}

.field span {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(16, 24, 20, .08);
}

.btn.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn.warning {
  background: var(--brand-2);
}

.btn.danger {
  background: var(--danger);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy {
  padding: 34px 0 20px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

h1 {
  max-width: 680px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  color: var(--ink);
  font-weight: 900;
  text-shadow: none;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.03rem;
}

.lead {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.hero-visual {
  min-height: 300px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(6, 69, 31, .04), rgba(6, 69, 31, .24)),
    url("/images/A.jpeg") center top / cover no-repeat;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin: 18px 0 12px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  overflow: hidden;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.session-card {
  border-left: 4px solid var(--brand);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 800;
}

.pill.ok {
  border-color: rgba(22, 112, 63, .25);
  background: rgba(13, 111, 35, .10);
  color: var(--ok);
}

.pill.warn {
  border-color: rgba(217, 154, 41, .35);
  background: rgba(217, 154, 41, .12);
  color: #7b4e05;
}

.pill.danger {
  border-color: rgba(180, 35, 24, .28);
  background: rgba(180, 35, 24, .08);
  color: var(--danger);
}

.menu-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.price {
  color: var(--brand-2);
  font-size: 1.08rem;
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.cart-line,
.order-line,
.admin-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line:last-child,
.order-line:last-child,
.admin-line:last-child {
  border-bottom: 0;
}

.qty {
  display: inline-grid;
  grid-template-columns: 36px 40px 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.qty button {
  height: 36px;
  border: 0;
  background: #fff;
  font-weight: 900;
}

.qty span {
  text-align: center;
  font-weight: 800;
}

.panel {
  padding: 16px;
}

.stack {
  display: grid;
  gap: 14px;
}

.totals {
  display: grid;
  gap: 8px;
}

.totals div {
  display: flex;
  justify-content: space-between;
}

.totals strong {
  font-size: 1.15rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
}

.receipt-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-admin {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
}

.qr-admin img,
.qr-placeholder {
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed #c8d3ca;
  border-radius: var(--radius);
  background: rgba(255, 253, 243, .7);
  padding: 22px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 64px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.bottom-nav span {
  font-size: 1.15rem;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 12px 12px 84px;
  }

  .auth-card,
  .auth-card.signed-in,
  .auth-page,
  .hero,
  .grid,
  .grid.two,
  .admin-layout,
  .login-screen,
  .address-list.compact,
  .address-row,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .auth-product {
    min-height: 440px;
    padding: 22px;
  }

  .auth-product-image {
    display: none;
  }

  .auth-card-pro {
    width: calc(100% - 24px);
    margin: 12px 0 28px;
  }

  body.auth-mode .app-shell {
    padding: 12px;
  }

  .login-screen {
    min-height: 0;
  }

  .login-art {
    min-height: 240px;
  }

  .login-art::after {
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 12px;
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }

  .login-note {
    display: grid;
  }

  .hero-copy {
    padding: 16px 0 4px;
  }

  .hero-visual {
    min-height: 260px;
    background-position: center top;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
