:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #1f2a24;
  --muted: #66726b;
  --line: #dcd6ca;
  --brand: #0f8b6f;
  --brand-dark: #08614d;
  --accent: #d84a2b;
  --gold: #f2b84b;
  --shadow: 0 20px 55px rgba(31, 42, 36, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 139, 111, 0.09), transparent 30%),
    linear-gradient(315deg, rgba(216, 74, 43, 0.08), transparent 35%),
    var(--bg);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #15221d;
  color: #f7f5ef;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #14211c;
  font-weight: 900;
}

.brand span,
.plan-box span {
  display: block;
  color: #b9c5bf;
  font-size: 0.82rem;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #dfe8e3;
  background: transparent;
  text-align: left;
}

.nav-button span:first-child {
  display: grid;
  width: 24px;
  place-items: center;
}

.nav-button.active,
.nav-button:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.plan-box {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.plan-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
}

.plan-box p {
  margin: 8px 0 0;
  color: #d6ded9;
  font-size: 0.9rem;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
  padding: 30px;
}

.topbar,
.section-header,
.panel-title,
.form-actions,
.order-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.65rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.section-header p,
.panel p {
  color: var(--muted);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(15, 139, 111, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.phone-frame,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.dashboard-grid,
.editor-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.4fr);
  gap: 18px;
}

.panel {
  padding: 20px;
}

.restaurant-form,
.item-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #3b4942;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfc7b8;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 11px 12px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 139, 111, 0.15);
}

.primary-action,
.ghost-action,
.item-actions button,
.table-card button,
.order-bar button,
.quantity button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-action {
  padding: 0 16px;
  background: var(--brand);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--brand-dark);
}

.ghost-action {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
}

.status-list,
.item-list,
.public-items {
  display: grid;
  gap: 12px;
}

.status-list div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: #f7f3ea;
}

.status-list span {
  color: var(--muted);
}

.dashboard-side {
  display: grid;
  gap: 18px;
}

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

.qr-panel .panel-title span {
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.qr-panel img {
  width: min(240px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border: 12px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(31, 42, 36, 0.12);
}

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

#systemStatus {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 139, 111, 0.12);
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.admin-item.unavailable {
  opacity: 0.58;
}

.admin-item strong,
.admin-item span {
  display: block;
}

.admin-item span {
  margin-top: 4px;
  color: var(--brand-dark);
  font-weight: 800;
}

.admin-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.item-actions {
  display: flex;
  gap: 7px;
}

.item-actions button {
  width: 40px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.table-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.table-card img {
  width: 148px;
  height: 148px;
  justify-self: center;
  border: 10px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
}

.table-card code {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-card button {
  background: #26352e;
  color: #ffffff;
}

.phone-preview {
  display: grid;
  place-items: start center;
}

.phone-frame {
  overflow: hidden;
  width: min(430px, 100%);
  min-height: 720px;
  background: #fbf7ee;
}

.menu-hero {
  padding: 28px 22px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(21, 34, 29, 0.35), rgba(21, 34, 29, 0.88)),
    url("../assets/menu-foto.png") no-repeat
      center/cover;
}

.menu-hero span {
  display: inline-flex;
  margin-bottom: 52px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.menu-hero h2 {
  margin: 0 0 6px;
  font-size: 2rem;
}

.menu-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 16px 10px;
}

.category-chips button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.category-chips button.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.public-items {
  padding: 8px 16px 92px;
}

.public-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.public-item strong,
.public-item span {
  display: block;
}

.public-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quantity {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
}

.quantity button {
  width: 34px;
  min-height: 34px;
  background: var(--accent);
  color: #ffffff;
}

.order-bar {
  position: sticky;
  bottom: 0;
  min-height: 68px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.order-bar button {
  padding: 0 14px;
  background: var(--ink);
  color: #ffffff;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px;
  }

  .nav-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
  }

  .nav-button span:last-child,
  .plan-box {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .metric-grid,
  .dashboard-grid,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .brand {
    justify-content: center;
  }

  .brand div:last-child {
    display: none;
  }

  .sidebar {
    gap: 12px;
  }

  .metric-grid {
    gap: 10px;
  }

  .admin-item,
  .form-actions,
  .qr-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .item-actions {
    justify-content: flex-end;
  }
}
