:root {
  --ink: #18201d;
  --muted: #66716b;
  --paper: #fbf7ef;
  --surface: #fff;
  --line: #dfd5c5;
  --charcoal: #101820;
  --tomato: #d9412e;
  --mustard: #e4aa24;
  --leaf: #387f49;
  --cream: #fff8e8;
  --shadow: 0 14px 34px rgba(24, 32, 29, .11);
}

:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid rgba(223, 213, 197, .8);
  background: rgba(245, 245, 247, .86);
  backdrop-filter: blur(22px);
}

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

.mark {
  width: 46px;
  height: 46px;
  border: 3px solid var(--charcoal);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--mustard);
  color: var(--charcoal);
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(217, 65, 46, .18);
  flex: 0 0 auto;
}

h1 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  padding: 22px clamp(14px, 3vw, 34px) 42px;
}

.kitchen-layout {
  padding: 22px clamp(14px, 3vw, 34px) 42px;
}

.hero {
  min-height: 190px;
  border: 1px solid rgba(0, 0, 0, .06);
  background: linear-gradient(135deg, #ffffff, #f7f7f9);
  padding: clamp(18px, 4vw, 36px);
  display: grid;
  align-content: end;
  gap: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .08);
  margin-bottom: 18px;
}

.hero h2 {
  max-width: 880px;
  font-size: clamp(34px, 5.8vw, 76px);
  line-height: .9;
  text-transform: uppercase;
}

.qr-card {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 24px;
  background:
    linear-gradient(90deg, #1d1d1f 12px, transparent 12px 22px, #1d1d1f 22px 34px, transparent 34px),
    linear-gradient(#1d1d1f 12px, transparent 12px 22px, #1d1d1f 22px 34px, transparent 34px),
    #fff;
  background-size: 44px 44px;
  border: 10px solid #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px 180px;
  gap: 10px;
  margin-bottom: 14px;
}

.field,
.select,
textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, .08);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  outline: none;
}

.field,
.select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 76px;
  resize: vertical;
  padding: 10px 12px;
}

.field:focus,
.select:focus,
textarea:focus {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(217, 65, 46, .12);
}

.menu-grid,
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.card,
.panel {
  border: 1px solid rgba(0, 0, 0, .06);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .07);
}

.card {
  min-height: 240px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.card-head,
.panel-title,
.order-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card h3,
.panel h2 {
  font-size: 18px;
  line-height: 1.12;
}

.price {
  color: var(--tomato);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.chip,
.status {
  border: 1px solid rgba(0, 0, 0, .06);
  background: #f5f5f7;
  color: #4b554f;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.status.nuevo {
  background: #fff1c7;
  color: #7a5200;
}

.status.preparando {
  background: #e8f2ff;
  color: #164b82;
}

.status.listo {
  background: #e5f7e7;
  color: #1c6a35;
}

.status.entregado {
  background: #efefef;
  color: #555;
}

.btn,
.icon-btn {
  min-height: 42px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  background: var(--surface);
  color: var(--charcoal);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn {
  padding: 0 14px;
}

.icon-btn {
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .12);
}

.btn.primary {
  background: #007aff;
  color: #fff;
}

.btn.dark {
  background: #1d1d1f;
  color: #fff;
}

.btn.mustard {
  background: #ffcc00;
}

.btn.ghost {
  border-color: var(--line);
  color: var(--muted);
}

.item-actions,
.checkout-actions,
.kitchen-actions {
  display: grid;
  gap: 8px;
}

.item-actions {
  grid-template-columns: 42px 1fr;
  margin-top: auto;
}

.sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  display: grid;
  gap: 12px;
}

.panel {
  padding: 16px;
}

.customer-panel {
  margin-bottom: 14px;
}

.menu-card {
  min-height: auto;
}

.ingredients-panel {
  border-top: 1px solid rgba(0, 0, 0, .06);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding: 10px 0;
}

.ingredients-panel summary {
  color: #007aff;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.ingredients-panel summary::-webkit-details-marker {
  display: none;
}

.ingredient-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ingredient-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr 42px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f5f5f7;
}

.ingredient-row.removed {
  color: var(--muted);
  text-decoration: line-through;
  background: #eeeeef;
}

.panel-title {
  margin-bottom: 12px;
}

.order-list {
  display: grid;
  gap: 8px;
  min-height: 86px;
}

.empty {
  min-height: 86px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 14px;
}

.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #eee3d4;
}

.order-row:last-child {
  border-bottom: 0;
}

.qty {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
}

.qty button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--cream);
  font-weight: 900;
}

.totals {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.total-line strong {
  color: var(--ink);
  font-size: 28px;
}

.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.pay-methods label {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f5f7;
  font-weight: 900;
}

.pay-methods input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pay-methods label:has(input:checked) {
  background: #1d1d1f;
  color: #fff;
  border-color: var(--charcoal);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.metric {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.metric strong {
  font-size: 24px;
  line-height: 1;
}

.kitchen-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

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

.order-items small {
  display: block;
  color: var(--tomato);
  font-weight: 700;
  margin-top: 3px;
}

.login-panel {
  max-width: 430px;
  display: grid;
  gap: 10px;
}

.admin-section {
  margin-top: 16px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 130px auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 16px;
  background: #f8f8fa;
}

.admin-row textarea {
  min-height: 58px;
  margin-top: 8px;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.order-card h2 {
  font-size: 34px;
  line-height: 1;
}

.order-items {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  transform: translate(-50%, 120px);
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform .24s ease;
  font-weight: 850;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (max-width: 1060px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  .kitchen-head,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .toolbar,
  .menu-grid,
  .orders-grid,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .layout {
    padding: 14px 12px 120px;
    gap: 12px;
  }

  .hero {
    min-height: 150px;
    border-radius: 22px;
  }

  .hero h2 {
    font-size: 44px;
  }

  .sidebar {
    gap: 10px;
  }
}
