:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-2: #f0eee7;
  --ink: #1f2522;
  --muted: #68716b;
  --line: #d9d6cc;
  --brand: #146c5b;
  --brand-2: #d05a2f;
  --warn: #b7791f;
  --danger: #b42318;
  --ok: #147a46;
  --shadow: 0 18px 48px rgba(22, 29, 25, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(31, 37, 34, 0.1);
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.brand-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-link,
.ghost-button,
.primary-button,
.danger-button,
.status-button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  padding: 9px 12px;
  font-weight: 750;
}

.nav-link.active,
.primary-button {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.danger-button {
  border-color: rgba(180, 35, 24, 0.28);
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  width: 40px;
  place-items: center;
  padding: 0;
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: clamp(22px, 4vw, 42px) 0 28px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.05;
}

h3 {
  font-size: 18px;
}

.lead {
  max-width: 680px;
  color: #4d5751;
  font-size: clamp(17px, 2.2vw, 21px);
  line-height: 1.55;
}

.hero-actions,
.row,
.filters,
.language-switcher,
.payment-grid,
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.demo-panel,
.panel,
.order-card,
.menu-item,
.category-block,
.cart-panel,
.stat-card {
  border: 1px solid rgba(31, 37, 34, 0.1);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(31, 37, 34, 0.04);
}

.demo-panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.demo-screen {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111815;
  color: white;
}

.demo-screen-top {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.demo-screen-body {
  padding: 16px;
}

.qr-placeholder {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 148px;
  height: 148px;
  padding: 10px;
  border-radius: 8px;
  background: white;
}

.qr-placeholder span {
  border-radius: 2px;
  background: #111815;
}

.qr-placeholder span:nth-child(3n + 1),
.qr-placeholder span:nth-child(5n) {
  opacity: 0.18;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

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

.panel,
.cart-panel {
  padding: 16px;
}

.category-block {
  overflow: hidden;
}

.category-heading {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.category-heading h3,
.category-heading p {
  margin: 0;
}

.category-toggle:hover {
  background: #e9e5da;
}

.category-plus {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.menu-list {
  display: grid;
}

.menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
}

.menu-item:last-child {
  border-bottom: 0;
}

.menu-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.price {
  color: var(--brand);
  font-weight: 850;
  white-space: nowrap;
}

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

.qty-control button {
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
}

.qty-control strong {
  text-align: center;
}

.cart-panel {
  position: sticky;
  top: 84px;
}

.cart-lines {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cart-line small,
.muted {
  color: var(--muted);
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 2px solid var(--ink);
  font-size: 18px;
  font-weight: 900;
}

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

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

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

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.payment-option {
  flex: 1 1 145px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  text-align: left;
}

.payment-option.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(20, 108, 91, 0.16);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #111815;
  color: white;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.badge.new {
  background: rgba(208, 90, 47, 0.12);
  color: var(--brand-2);
}

.badge.preparing,
.badge.accepted {
  background: rgba(183, 121, 31, 0.12);
  color: var(--warn);
}

.badge.completed {
  background: rgba(20, 122, 70, 0.12);
  color: var(--ok);
}

.badge.cancelled {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.orders-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
}

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

.order-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-items {
  margin: 0;
  padding-left: 18px;
  color: #3d453f;
}

.status-button {
  background: var(--surface-2);
}

.status-button.active {
  border-color: var(--brand);
  background: rgba(20, 108, 91, 0.09);
  color: var(--brand);
}

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

.stat-card {
  padding: 16px;
}

.stat-card strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

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

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form .primary-button {
  width: 100%;
}

.admin-item-row {
  align-items: start;
}

.copy-box {
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  color: #3f4741;
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero,
  .grid,
  .orders-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }

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

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-link {
    flex: 1 1 auto;
    text-align: center;
  }

  .main {
    padding: 16px;
  }

  .menu-item {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
