:root {
  --bg: #fff7ea;
  --panel: #ffffff;
  --text: #17342f;
  --muted: #6b7771;
  --line: #eadfc9;
  --brand: #08796f;
  --brand-dark: #075d56;
  --accent: #f0a340;
  --accent-soft: #fff0cf;
  --ink: #123b36;
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 24px 70px rgba(25, 58, 50, 0.12);
  --font-display: "Montserrat", "Aptos Display", "Segoe UI", Arial, Helvetica, sans-serif;
  --font-sans: "Montserrat", "Aptos", "Segoe UI", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 6%, rgba(var(--accent-rgb), 0.26), transparent 26rem),
    radial-gradient(circle at 88% 0%, rgba(var(--brand-rgb), 0.16), transparent 30rem),
    linear-gradient(180deg, rgba(var(--brand-rgb), 0.08) 0%, var(--bg) 48%, #fff 100%);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 0 0 12px;
}
h1 { font-size: clamp(2.25rem, 4.8vw, 4.35rem); }
h2 { font-size: clamp(1.65rem, 2.6vw, 2.35rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
p { color: var(--muted); line-height: 1.5; margin: 0 0 14px; }

.page { margin: 0 auto; max-width: 1120px; padding: 24px; }
.public-shell { max-width: 980px; }
.grid { display: grid; gap: 16px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
.hidden { display: none !important; }

.panel, .card, .home-card, .login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.admin-panel { margin-top: 18px; }

label { display: grid; font-weight: 800; gap: 7px; }
input, select, textarea {
  background: #fffdf8;
  border: 1px solid #ddcfb7;
  border-radius: 12px;
  font: inherit;
  min-height: 48px;
  padding: 12px 14px;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.12);
  outline: none;
}

button, .button {
  align-items: center;
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
}
button:hover, .button:hover { background: var(--brand-dark); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.secondary, .button.secondary { background: #eef4ef; color: var(--ink); }
.danger { background: var(--danger); }
.ghost { background: rgba(255,255,255,0.84); color: var(--ink); }

.alert {
  border-radius: 12px;
  font-weight: 800;
  padding: 12px 14px;
}
.alert.error { background: #fee4e2; color: var(--danger); }
.alert.success { background: #dcfae6; color: var(--ok); }

.brand-kicker {
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.16em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.home-shell, .login-shell {
  display: grid;
  min-height: 100vh;
  padding: 20px;
  place-items: center;
}
.home-card, .login-card { max-width: 760px; width: 100%; }
.home-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
.home-option {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 8px;
  padding: 22px;
}
.home-option span { color: var(--muted); font-weight: 800; }
.home-option strong { color: var(--brand-dark); font-size: 24px; }

.menu-page {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 42vw) minmax(0, 1fr);
  max-width: none;
  min-height: 100vh;
  padding: 16px;
  width: 100%;
}
.menu-hero {
  background:
    linear-gradient(120deg, rgba(var(--brand-rgb), 0.94), rgba(var(--brand-rgb), 0.58)),
    var(--hero-image, url("/assets/img/products/sandwich-pollo.png"));
  background-position: center;
  background-size: cover;
  border-radius: 28px;
  box-shadow: var(--shadow);
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
  height: calc(100vh - 32px);
  min-height: 680px;
  overflow: hidden;
  padding: 22px;
  position: sticky;
  top: 16px;
}
.brand-bar { align-items: center; display: flex; justify-content: space-between; }
.brand-lockup { align-items: center; color: #fff; display: inline-flex; font-weight: 900; gap: 10px; }
.brand-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 14px;
  color: var(--ink);
  display: inline-flex;
  font-family: var(--font-display);
  font-weight: 900;
  height: 44px;
  justify-content: center;
  width: 44px;
}
.brand-mark-image {
  background: #fff;
  overflow: hidden;
  padding: 0;
}
.brand-mark-image img {
  display: block;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  width: 100%;
}
.hero-copy { align-self: center; display: grid; max-width: 720px; }
.hero-copy h1, .hero-copy p { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.18); }
.hero-copy p { font-size: clamp(1.05rem, 2vw, 1.24rem); }
.location-chip, .eyebrow {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  justify-self: start;
  margin-bottom: 12px;
  padding: 8px 12px;
  text-transform: uppercase;
}
.order-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-height: calc(100vh - 32px);
  padding: clamp(20px, 2.6vw, 36px);
}
.order-flow { display: grid; gap: 20px; }
.order-header { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.order-header h2 { margin-bottom: 6px; }
.total-pill {
  background: var(--ink);
  border-radius: 20px;
  color: #fff;
  display: grid;
  min-width: 134px;
  padding: 12px 16px;
  white-space: nowrap;
}
.total-pill span { color: rgba(255,255,255,0.72); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.total-pill strong { font-family: var(--font-display); font-size: 28px; }
.progress-track { background: #eadfc9; border-radius: 999px; height: 8px; overflow: hidden; }
.progress-track span { background: linear-gradient(90deg, var(--brand), var(--accent)); display: block; height: 100%; transition: width 180ms ease; }
.step-tabs {
  background: #f6eddc;
  border: 1px solid #eadfc9;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px;
}
.step { background: transparent; border-radius: 14px; color: var(--muted); gap: 7px; min-height: 52px; padding: 8px; }
.step.active, .step:hover { background: #fff; box-shadow: 0 8px 24px rgba(42,68,54,0.08); color: var(--ink); }
.step span {
  align-items: center;
  background: rgba(var(--brand-rgb), 0.12);
  border-radius: 999px;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}
.step-panel { display: grid; gap: 18px; min-height: 320px; }
.product-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.product-card, .choice-card, .slot-card {
  background: #fffdf8;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px #e7dac4;
  color: var(--text);
  min-height: auto;
  text-align: left;
}
.product-card:hover, .choice-card:hover, .slot-card:hover,
.product-card.selected, .choice-card.selected, .slot-card.selected {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 12px 28px rgba(var(--brand-rgb), 0.16);
  color: var(--text);
}
.product-card { align-items: stretch; border-radius: 22px; display: grid; gap: 12px; overflow: hidden; padding: 10px 10px 14px; position: relative; }
.product-card img, .image-placeholder { aspect-ratio: 4 / 3; border-radius: 16px; display: grid; object-fit: cover; place-items: center; width: 100%; }
.image-placeholder { background: var(--accent-soft); color: var(--brand-dark); font-family: var(--font-display); font-size: 42px; }
.product-copy { align-items: center; display: flex; gap: 10px; justify-content: space-between; padding: 0 4px; }
.product-copy span, .choice-card span { font-weight: 900; }
.product-copy strong, .choice-card strong { color: var(--brand-dark); }
.selected-indicator {
  background: var(--accent);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  padding: 7px 10px;
  position: absolute;
  right: 18px;
  top: 18px;
}
.product-card.selected .selected-indicator { opacity: 1; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.tag-row em, .choice-card small {
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}
.option-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-card { align-items: center; border-radius: 18px; display: grid; gap: 8px; grid-template-columns: 1fr auto; min-height: 84px; }
.choice-card small { grid-column: 1 / -1; justify-self: start; }
.slot-grid { display: grid; gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.slot-card { border-radius: 20px; font-size: 22px; font-weight: 900; justify-content: center; min-height: 90px; text-align: center; }
.flow-actions { display: flex; gap: 10px; justify-content: space-between; }
.flow-actions button { min-width: 150px; }
.summary-strip {
  align-items: center;
  background: #f6eddc;
  border: 1px solid #eadfc9;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}
.summary-strip span, .summary-strip strong { background: #fff; border-radius: 999px; padding: 8px 12px; }

.admin-nav {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
}
.admin-nav div:first-child { display: grid; }
.admin-nav span { color: var(--muted); }
.nav-links, .actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links a, .nav-links button { background: #eef4ef; border-radius: 999px; color: var(--ink); min-height: 40px; padding: 9px 13px; }
.topbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 16px; }
.stat-card h2 { color: var(--brand-dark); }
.filters { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(120px, 1fr)); margin-bottom: 16px; }
.menu-option-create { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
.option-row { grid-template-columns: 120px 1.1fr 100px 1.4fr 1fr 110px 100px; margin-bottom: 0; }
.check-label { align-items: center; display: flex; gap: 8px; }
.check-label input { min-height: auto; width: auto; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 980px; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; }
.inline-form { display: grid; gap: 8px; min-width: 190px; }
.quick-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.config-page { max-width: 1360px; }
.config-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: 260px minmax(0, 1fr);
}
.config-sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  position: sticky;
  top: 16px;
}
.config-sidebar-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sidebar-title {
  color: var(--ink);
  font-weight: 900;
  padding-left: 6px;
}
.icon-button {
  border-radius: 12px;
  min-height: 42px;
  padding: 0;
  width: 42px;
}
.settings-tabs {
  display: grid;
  gap: 8px;
}
.settings-tabs button {
  background: transparent;
  border-radius: 14px;
  color: var(--muted);
  gap: 10px;
  justify-content: flex-start;
  min-height: 48px;
  padding: 9px 10px;
  width: 100%;
}
.settings-tabs button:hover,
.settings-tabs button.active {
  background: #eef4ef;
  color: var(--ink);
}
.tab-initial {
  align-items: center;
  background: rgba(var(--brand-rgb), 0.12);
  border-radius: 10px;
  display: inline-flex;
  flex: 0 0 30px;
  height: 30px;
  justify-content: center;
}
.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.config-content { min-width: 0; }
.config-layout.collapsed {
  grid-template-columns: 74px minmax(0, 1fr);
}
.config-layout.collapsed .sidebar-title,
.config-layout.collapsed .tab-label {
  display: none;
}
.config-layout.collapsed .config-sidebar-head,
.config-layout.collapsed .settings-tabs button {
  justify-content: center;
}
.settings-form {
  display: grid;
  gap: 0;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin: 16px 0 6px;
}
.color-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
}
input[type="color"] {
  cursor: pointer;
  height: 52px;
  padding: 5px;
}
.media-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.media-field {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  padding: 14px;
}
.media-preview {
  align-items: center;
  aspect-ratio: 16 / 9;
  background: #f6eddc;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.media-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.form-help {
  background: rgba(var(--brand-rgb), 0.08);
  border: 1px solid rgba(var(--brand-rgb), 0.14);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  padding: 12px 14px;
}

.ticket-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: start center;
}
.ticket-shell {
  display: grid;
  gap: 16px;
  max-width: 520px;
  width: 100%;
}
.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ticket {
  background:
    radial-gradient(circle at left 98px, transparent 0 12px, #fff 13px),
    radial-gradient(circle at right 98px, transparent 0 12px, #fff 13px),
    linear-gradient(#fff, #fff);
  border: 1px solid #eadfc9;
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: #1f2d29;
  overflow: hidden;
  padding: 0 26px 26px;
  position: relative;
}
.ticket::before,
.ticket::after {
  background: var(--bg);
  border: 1px solid #eadfc9;
  border-radius: 50%;
  content: "";
  height: 26px;
  position: absolute;
  top: 85px;
  width: 26px;
}
.ticket::before { left: -14px; }
.ticket::after { right: -14px; }
.ticket-head {
  display: grid;
  justify-items: center;
  padding: 28px 0 18px;
  text-align: center;
}
.ticket-head .brand-mark { color: var(--ink); margin-bottom: 10px; }
.ticket-head .brand-kicker { margin-bottom: 8px; }
.ticket-head h1 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  margin-bottom: 8px;
}
.ticket-cut {
  border-top: 2px dashed #dbcab0;
  margin: 0 -26px 18px;
}
.ticket-block {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}
.ticket-block h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.ticket-row {
  align-items: baseline;
  border-bottom: 1px dotted #d8c7ad;
  display: grid;
  gap: 12px;
  grid-template-columns: 120px 1fr;
  padding-bottom: 8px;
}
.ticket-row span,
.ticket-note span,
.ticket-total span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}
.ticket-row strong {
  justify-self: end;
  text-align: right;
}
.ticket-note {
  background: #fff7ea;
  border-radius: 12px;
  padding: 10px;
}
.ticket-note p,
.ticket-instructions {
  margin: 6px 0 0;
}
.ticket-total {
  align-items: center;
  background: var(--ink);
  border-radius: 16px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 16px;
}
.ticket-total span {
  color: rgba(255,255,255,0.72);
}
.ticket-total strong {
  font-family: var(--font-display);
  font-size: 2rem;
}

@media (max-width: 980px) {
  .menu-page { display: block; padding: 0 0 18px; }
  .menu-hero { border-radius: 0 0 26px 26px; height: auto; min-height: 520px; position: relative; top: auto; }
  .order-card { margin: 12px; min-height: auto; padding: 16px; }
  .config-layout, .config-layout.collapsed { display: block; }
  .config-sidebar {
    margin-bottom: 14px;
    position: relative;
    top: auto;
  }
  .config-sidebar-head { margin-bottom: 8px; }
  .config-sidebar .icon-button { display: none; }
  .config-layout.collapsed .sidebar-title,
  .config-layout.collapsed .tab-label {
    display: inline;
  }
  .settings-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .settings-tabs button {
    flex: 0 0 auto;
    width: auto;
  }
  .option-grid, .slot-grid, .filters, .menu-option-create, .option-row, .color-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .page { padding: 14px; }
  .two, .three, .home-grid { grid-template-columns: 1fr; }
  .admin-nav, .topbar, .order-header, .flow-actions { align-items: stretch; flex-direction: column; }
  .brand-lockup { min-width: 0; }
  .hero-copy h1 { font-size: clamp(2.35rem, 11vw, 3.2rem); }
  .step-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; }
  .step { font-size: 0; gap: 0; min-width: 0; padding: 7px 4px; }
  .step span { font-size: 13px; }
  .product-grid { grid-template-columns: 1fr; }
  .choice-card, .slot-card { min-height: 68px; }
  .ticket-page { padding: 12px; }
  .ticket { padding-left: 18px; padding-right: 18px; }
  .ticket-cut { margin-left: -18px; margin-right: -18px; }
  .ticket-row { grid-template-columns: 1fr; gap: 4px; }
  .ticket-row strong { justify-self: start; text-align: left; }
}

@media print {
  body {
    background: #fff;
  }
  .no-print,
  .ticket-actions {
    display: none !important;
  }
  .ticket-page {
    display: block;
    min-height: auto;
    padding: 0;
  }
  .ticket-shell {
    max-width: none;
  }
  .ticket {
    border: 1px solid #999;
    box-shadow: none;
    margin: 0 auto;
    max-width: 380px;
  }
}
