:root {
  --ink: #17211b;
  --muted: #68746e;
  --line: #dde4de;
  --paper: #f7f4ec;
  --surface: #fffdf7;
  --green: #1f6b4d;
  --green-soft: #dcefe6;
  --red: #aa3f35;
  --gold: #b8872f;
  --blue: #265c7c;
  --shadow: 0 22px 60px rgba(26, 35, 29, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #e8e5da;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

html,
#app,
.app-shell {
  max-width: 100%;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(23, 33, 27, 0.12);
  background: rgba(255, 253, 247, 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-mark,
.store-logo,
.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-lockup small,
.store-profile span,
.page-title p,
.page-head p,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.mode-switch {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.mode-switch button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
}

.mode-switch button.active {
  background: var(--ink);
  color: white;
}

.customer-stage {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 79px);
  padding: 34px 18px;
}

.phone-frame {
  width: min(100%, 390px);
  height: 820px;
  max-height: calc(100vh - 115px);
  background: #101713;
  border: 10px solid #101713;
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.phone-status {
  height: 34px;
  padding: 0 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.screen {
  height: calc(100% - 98px);
  background: var(--paper);
  overflow: hidden;
  padding: 18px;
}

.scroll-screen {
  overflow-y: auto;
}

.mobile-hero {
  padding: 6px 0 16px;
}

.mobile-hero p,
.redeem-header p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
p {
  margin-top: 0;
}

.mobile-hero h1,
.detail-content h1,
.redeem-header h1,
.profile-head h1,
.page-title h1,
.page-head h1 {
  margin-bottom: 0;
  letter-spacing: 0;
}

.search-pill {
  height: 46px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  margin-bottom: 16px;
}

.search-icon,
.tab-icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  position: relative;
}

.search-icon::before {
  content: "";
  position: absolute;
  inset: 1px 4px 4px 1px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: 0;
  bottom: 1px;
  background: currentColor;
  transform: rotate(45deg);
}

.program-grid {
  display: grid;
  gap: 13px;
  padding-bottom: 12px;
}

.program-card,
.subscription-card,
.table-card,
.wide-panel,
.metric-grid article,
.product-list article,
.bar-panel {
  background: var(--surface);
  border: 1px solid rgba(23, 33, 27, 0.1);
  border-radius: 8px;
}

.program-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 118px;
  overflow: hidden;
}

.shop-photo,
.detail-photo {
  position: relative;
  isolation: isolate;
  color: white;
  background: #365443;
}

.shop-photo::before,
.detail-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.86;
  background:
    radial-gradient(circle at 26% 22%, rgba(255,255,255,.22) 0 8%, transparent 9%),
    linear-gradient(135deg, rgba(255,255,255,.16), transparent 35%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 7px, transparent 7px 18px);
  z-index: -1;
}

.shop-photo span,
.detail-photo span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-weight: 800;
  text-shadow: 0 1px 8px rgba(0,0,0,.25);
}

.shop-a { background-color: #315f4b; }
.shop-b { background-color: #6e4c35; }
.shop-c { background-color: #285671; }
.shop-d { background-color: #8a513d; }
.shop-e { background-color: #70652f; }
.shop-f { background-color: #4c5068; }
.shop-g { background-color: #9d6b2d; }
.shop-h { background-color: #4f695d; }
.shop-i { background-color: #754448; }
.shop-j { background-color: #335f70; }

.program-body {
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-width: 0;
}

.program-body p,
.subscription-card p,
.description {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.top-align {
  align-items: flex-start;
}

.rating,
.chip,
.status-pill {
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 8px;
  white-space: nowrap;
}

.chip.available {
  background: #f0e4c7;
  color: #74551c;
}

.price {
  color: var(--ink);
  font-weight: 800;
}

.back-button,
.tenant-content button,
.mobile-tabs button,
.subscription-card button,
.remaining-strip button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
}

.detail-screen,
.redeem-screen {
  overflow-y: auto;
}

.detail-photo {
  height: 210px;
  border-radius: 8px;
  margin: 12px 0 18px;
  overflow: hidden;
}

.detail-photo span {
  font-size: 28px;
}

.detail-content {
  display: grid;
  gap: 16px;
}

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

.detail-metrics div,
.price-panel,
.redeem-code,
.remaining-strip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.detail-metrics div:last-child {
  grid-column: 1 / -1;
}

.detail-metrics strong,
.detail-metrics span,
.price-panel span,
.redeem-code span {
  display: block;
}

.detail-metrics span,
.price-panel span,
.redeem-code span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.price-panel strong {
  display: block;
  font-size: 26px;
}

.primary-action {
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.redeem-header {
  padding: 20px 0 12px;
  text-align: center;
}

.qr-wrap {
  display: grid;
  place-items: center;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(8, 20px);
  grid-template-rows: repeat(8, 20px);
  gap: 5px;
  padding: 18px;
  background: white;
  border: 9px solid #f2f2ef;
}

.qr-grid span.dark {
  background: var(--ink);
}

.redeem-code {
  margin: 16px 0;
  text-align: center;
}

.redeem-code strong {
  font-size: 36px;
  letter-spacing: 0;
}

.remaining-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 18px;
}

.avatar {
  background: var(--blue);
}

.subscription-card {
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 12px;
}

.cup-meter {
  display: grid;
  gap: 6px;
}

.cup-meter div,
.capacity-row div,
.bar-row div {
  height: 9px;
  border-radius: 999px;
  background: #e9ece7;
  overflow: hidden;
}

.cup-meter i,
.capacity-row i,
.bar-row i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.mobile-tabs {
  height: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: white;
  border-top: 1px solid var(--line);
}

.mobile-tabs button {
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-tabs button.active {
  color: var(--green);
}

.discover-icon,
.qr-icon,
.user-icon {
  border: 2px solid currentColor;
}

.discover-icon {
  border-radius: 50%;
}

.qr-icon {
  border-radius: 3px;
  box-shadow: inset 5px 0 0 currentColor;
}

.user-icon {
  border-radius: 50% 50% 45% 45%;
}

.tenant-stage {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 79px);
}

.sidebar {
  background: #19241f;
  color: white;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.store-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.store-logo {
  background: #f2cc7a;
  color: #1d241f;
}

.sidebar button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  text-align: left;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

.sidebar button.active {
  color: white;
  background: rgba(255,255,255,.12);
}

.tenant-content {
  padding: 30px;
  overflow: auto;
}

.tenant-screen {
  display: grid;
  gap: 22px;
}

.page-title h1,
.page-head h1 {
  font-size: clamp(28px, 4vw, 42px);
}

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

.metric-grid article {
  padding: 18px;
}

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

.metric-grid strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.wide-panel,
.bar-panel {
  padding: 20px;
}

.panel-head,
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  margin: 0;
}

.profile-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

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

.config-panel {
  display: grid;
  gap: 15px;
}

.table-card {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

td span {
  display: block;
  color: var(--muted);
  max-width: 440px;
  margin-top: 4px;
}

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

.product-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.product-list span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.capacity-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.bar-panel {
  display: grid;
  gap: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 190px 1fr 110px;
  align-items: center;
  gap: 14px;
}

.bar-row strong {
  text-align: right;
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px;
    gap: 8px;
  }

  .brand-lockup span:last-child {
    display: none;
  }

  .mode-switch button {
    padding: 8px 11px;
    font-size: 14px;
  }

  .customer-stage {
    padding: 0;
    place-items: start start;
  }

  .phone-frame {
    width: min(100vw, 390px);
    height: calc(100vh - 71px);
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .program-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .program-body .row-between:last-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .price {
    font-size: 15px;
  }

  .tenant-stage {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 70px;
    z-index: 4;
    padding: 12px;
    flex-direction: row;
    overflow-x: auto;
  }

  .store-profile {
    min-width: 210px;
    border: 0;
    margin: 0;
    padding: 0;
  }

  .sidebar button {
    white-space: nowrap;
  }

  .tenant-content {
    padding: 18px;
  }

  .metric-grid,
  .profile-grid,
  .form-grid,
  .product-list {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-row strong {
    text-align: left;
  }
}

@media (max-width: 430px) {
  .screen {
    padding: 14px;
  }
}
