:root {
  --ink: #1a1a1a;
  --rojo: #991b1b;
  --rojo-light: #dc2626;
  --dorado: #d97706;
  --crema: #fffbeb;
  --paper: #fefce8;
  --card: #ffffff;
  --line: #e5e5e5;
  --muted: #71717a;
  --bg: #fafaf9;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }

.top { background: linear-gradient(135deg, var(--rojo) 0%, #7f1d1d 100%); color: white; }
.top-inner, .wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 16px; }
.logo { text-decoration: none; font-weight: 700; font-size: 24px; font-style: italic; }
.logo small { display: block; font-weight: 400; font-size: 11px; opacity: 0.9; letter-spacing: 0.1em; text-transform: uppercase; font-style: normal; }
.top nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.top nav a { text-decoration: none; }
.btn { display: inline-block; background: var(--crema); color: var(--rojo); font-weight: 600; text-decoration: none; padding: 12px 20px; border: 0; border-radius: 6px; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 2px 8px rgba(153, 27, 27, 0.2); }
.btn:hover { background: #fef3c7; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(153, 27, 27, 0.3); }

.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; padding: 56px 0 48px; align-items: stretch; }
.hero-photo { border-radius: 16px; overflow: hidden; min-height: 280px; box-shadow: 0 4px 20px rgba(153, 27, 27, 0.15); background: #f4e8d8; }
.hero-photo img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; display: block; }
.hero-meta { font-size: 15px; color: var(--ink); line-height: 1.5; margin: 0 0 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-line { background: transparent; color: var(--rojo); border: 1px solid var(--rojo); box-shadow: none; }
.btn-line:hover { background: #fff1f2; }
.kicker { color: var(--dorado); font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 600; }
h1, h2, h3 { font-weight: 700; }
h1 { font-size: 40px; line-height: 1.2; margin: 12px 0; }
.lead { font-size: 17px; color: var(--muted); max-width: 34rem; line-height: 1.55; }

.mesas-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mesa-card { background: var(--card); border-radius: 14px; padding: 16px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.mesa-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.mesa-card .numero { font-size: 24px; font-weight: 700; color: var(--rojo); }
.mesa-card .cap { font-size: 12px; color: var(--muted); }
.mesa-card .status { margin-top: 8px; }
.mesa-card.ocupada { border: 2px solid var(--rojo); }
.mesa-card.libre { border: 2px solid #22c55e; }
.mesa-card.reservada { border: 2px solid var(--dorado); }
.mesa-card.on { box-shadow: 0 0 0 2px var(--rojo); }

.section { padding: 36px 0 20px; }
.section h2 { font-size: 26px; margin-bottom: 16px; }
.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.modules article { background: var(--card); border-radius: 12px; padding: 24px; border-top: 4px solid var(--rojo); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.modules article:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(153, 27, 27, 0.1); }
.mod-icon { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.mod-icon img { width: 100%; height: 100%; object-fit: cover; }
.modules h3 { margin: 0 0 10px; font-size: 17px; color: var(--rojo); }
.modules p { color: var(--muted); line-height: 1.55; margin: 0; font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
th { text-align: left; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #fef3c7; }
td, th { padding: 14px 12px; border-bottom: 1px solid var(--line); }
tbody tr { transition: background 0.2s ease; }
tbody tr:hover { background: #fffbeb; }
.note { color: var(--muted); font-size: 14px; margin-bottom: 12px; }

.tag { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag.libre { background: #dcfce7; color: #166534; }
.tag.ocupada { background: #fee2e2; color: #991b1b; }
.tag.reservada { background: #fef3c7; color: #92400e; }
.tag.cuenta { background: #dbeafe; color: #1e40af; }
.tag.pendiente { background: #fef3c7; color: #92400e; }
.tag.preparando { background: #fed7aa; color: #c2410c; }
.tag.listo { background: #bbf7d0; color: #166534; }
.tag.entregado, .tag.listo { background: #bbf7d0; color: #166534; }
.tag.cobrado { background: #e0e7ff; color: #3730a3; }

footer { padding: 36px 0 48px; color: var(--muted); font-size: 14px; }

.app { min-height: 100vh; display: grid; grid-template-rows: auto auto auto auto 1fr; }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; padding: 20px 24px 8px; background: var(--paper); }
.toolbar h1 { font-size: 24px; margin: 4px 0; }
.eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.tabs { display: flex; gap: 0; padding: 0 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.tabs button { background: transparent; border: none; padding: 12px 20px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--rojo); border-bottom-color: var(--rojo); }
.create { display: none; background: white; border: 1px solid var(--line); border-radius: 6px; padding: 16px; margin: 0 24px 12px; }
.create.open { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.create button { align-self: end; }
.workspace[hidden], .panel-section[hidden], .create[hidden] { display: none !important; }
.panel-section { padding: 16px 24px 32px; background: var(--paper); }
.stats input[type="text"] { margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; width: 200px; cursor: text; }
.menu-admin article.on { outline: 2px solid var(--rojo); }
.detail form { display: grid; gap: 4px; }
.cocina-board { display: grid; gap: 10px; padding-bottom: 20px; }

.stats { display: flex; gap: 8px; padding: 12px 24px; flex-wrap: wrap; background: var(--paper); }
.stats button, .stats div { background: white; border: 1px solid var(--line); padding: 8px 12px; min-width: 90px; text-align: left; border-radius: 4px; cursor: pointer; }
.stats strong { display: block; font-size: 18px; color: var(--rojo); }
.stats .on { border-color: var(--rojo); background: #fee2e2; }

.workspace { display: grid; grid-template-columns: 1.2fr 0.8fr; min-height: 0; background: var(--paper); }
.list, .detail { padding: 0 24px 32px; }
.list { overflow-y: auto; }
.row { cursor: pointer; transition: background 0.15s; }
.row:hover { background: #fefce8; }
.row.on { background: #fee2e2; }

.mesas-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-bottom: 20px; }

.detail { background: white; border-left: 1px solid var(--line); padding: 16px 24px 32px; overflow-y: auto; }
.detail h2 { font-size: 18px; margin: 0 0 4px; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; font-size: 14px; }
.meta span { display: block; color: var(--muted); font-size: 12px; }

label { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ghost { background: transparent; border: 1px solid var(--line); padding: 8px 12px; border-radius: 4px; cursor: pointer; }
.btn-panel { background: var(--rojo); color: white; border: 0; padding: 10px 16px; border-radius: 4px; cursor: pointer; font-weight: 500; }
.btn-panel:hover { background: #7f1d1d; }

.comanda { margin: 12px 0; }
.comanda-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; background: #fafaf9; border-radius: 4px; margin-bottom: 6px; font-size: 13px; }
.comanda-item .nombre { font-weight: 500; }
.comanda-item .nota { font-size: 11px; color: var(--dorado); font-style: italic; }

.factura-box { background: #f0fdf4; border: 1px solid #86efac; border-radius: 6px; padding: 12px; margin: 12px 0; font-size: 13px; }
.factura-box h4 { margin: 0 0 8px; font-size: 13px; color: #166534; }
.factura-box .cae { font-family: monospace; color: #166534; }

.arca-section { background: #fee2e2; border: 1px solid #fca5a5; border-radius: 6px; padding: 12px; margin: 12px 0; }
.arca-section h4 { margin: 0 0 8px; font-size: 13px; color: var(--rojo); }

.cocina-item { background: #fef3c7; border: 2px solid var(--dorado); border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.cocina-item.listo { background: #dcfce7; border-color: #22c55e; }
.cocina-item.on { box-shadow: 0 0 0 2px var(--rojo); }
.cocina-item .mesa { font-weight: 700; color: var(--rojo); }
.cocina-item .items { margin-top: 8px; font-size: 13px; }

.amount { text-align: right; font-variant-numeric: tabular-nums; }

.carta {
  margin-top: 8px;
  padding: 18px 18px 22px;
  background: #f3e6d8;
  border-radius: 20px;
  color: #2a1712;
}
.carta .catalog-header {
  align-items: end;
  margin: 0 0 28px;
  padding: 22px 22px 20px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 0 0, rgba(232, 184, 109, 0.18), transparent 46%),
    linear-gradient(135deg, #2a1712 0%, #3b2118 100%);
}
.carta-intro h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 42px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #f8efe4;
}
.carta .kicker { color: #e8b86d; }
.carta .filters button {
  background: transparent;
  border-color: rgba(248, 239, 228, 0.35);
  color: #f8efe4;
}
.carta .filters button:hover { border-color: #e8b86d; color: #f8efe4; }
.carta .filters button.active { background: #e8b86d; color: #2a1712; border-color: #e8b86d; }

.catalog-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { background: var(--card); border: 1px solid var(--line); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.filters button:hover { border-color: var(--rojo); }
.filters button.active { background: var(--rojo); color: white; border-color: var(--rojo); }

#catalog { display: grid; gap: 28px; }
.menu-section { margin: 0; }
.menu-section[hidden], .plato-card[hidden] { display: none; }
.menu-section h3 {
  margin: 0 0 14px;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 28px;
  font-weight: 500;
  color: #7f1d1d;
  border-bottom: 1px solid #e7d3bf;
  padding-bottom: 8px;
}
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.plato-card {
  background: #fffdf9;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #ead9c8;
  box-shadow: 0 10px 28px rgba(42, 23, 18, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.plato-card:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(127, 29, 29, 0.16); }
.plato-card.is-off { opacity: 0.72; }
.plato-photo { height: 210px; overflow: hidden; background: #efe0d0; }
.plato-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.plato-card:hover .plato-photo img { transform: scale(1.06); }
.plato-body { padding: 16px 16px 18px; }
.plato-body h4 {
  margin: 0 0 6px;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 22px;
  font-weight: 500;
  color: #2a1712;
}
.plato-body p { margin: 0; color: #6b5346; font-size: 14px; line-height: 1.45; min-height: 2.8em; }
.plato-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0e2d4; }
.plato-precio { font-size: 22px; font-weight: 700; color: #991b1b; letter-spacing: -0.02em; }
.plato-off { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #991b1b; background: #fee2e2; padding: 4px 8px; border-radius: 999px; }
.admin-link { text-align: center; margin-top: 36px; padding: 18px 16px; background: transparent; border: 1px dashed #d7c2ae; border-radius: 12px; color: #6b5346; }
.carta .admin-link .btn { background: transparent; color: #7f1d1d; border: 1px solid #c4a48e; box-shadow: none; }
.carta .admin-link .btn:hover { background: #fff7ef; }

.ambiente-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: center; }
.ambiente-copy p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
.ambiente-grid img { width: 100%; height: 280px; object-fit: cover; border-radius: 12px; }

.ubicacion-grid { grid-template-columns: repeat(3, 1fr); }
.map-embed { position: relative; margin-top: 20px; border-radius: 12px; overflow: hidden; height: 280px; box-shadow: 0 4px 20px rgba(153, 27, 27, 0.12); background: #e8eef2; isolation: isolate; }
.map-embed .map-canvas { position: relative; z-index: 1; width: 100%; height: 100%; min-width: 0; display: block; }
.map-fallback { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; color: #334155; font-size: 14px; padding: 16px; text-align: center; }
.map-caption { margin: 8px 0 0; font-size: 13px; }
.map-caption a { color: var(--rojo); }

.reserva-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; background: var(--card); border-radius: 12px; padding: 20px; margin-bottom: 8px; }
.reserva-form .full { grid-column: 1 / -1; }
.reserva-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.plato-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 20px; }
.plato-modal[hidden] { display: none; }
.plato-modal-card { background: white; border-radius: 14px; max-width: 480px; width: 100%; overflow: hidden; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.plato-modal-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.plato-modal-body { padding: 20px; }
.plato-modal-body h2 { margin: 0 0 6px; font-size: 22px; }
.plato-modal-body .price { font-size: 24px; margin: 4px 0; }
.plato-modal-body .cat { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.place-line { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.plato-modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.92); cursor: pointer; font-size: 22px; line-height: 1; }

.menu-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.menu-admin article { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; }
.menu-admin article.on { outline: 2px solid var(--rojo); }
.menu-admin .card-photo { height: 110px; }
.menu-admin .txt { padding: 10px; }
.menu-admin h3 { margin: 0 0 4px; font-size: 14px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.comanda-item { gap: 10px; }
.cocina-item { display: flex; gap: 12px; align-items: flex-start; }

@media (max-width: 960px) {
  .hero, .modules, .ubicacion-grid, .ambiente-grid, .workspace, .mesas-preview, .mesas-grid, .reserva-form { grid-template-columns: 1fr; }
  .top-inner, .toolbar { flex-direction: column; align-items: start; }
  .top nav { flex-wrap: wrap; }
  .hero-photo img { min-height: 200px; }
  h1 { font-size: 32px; }
  .carta { padding: 24px 16px 20px; }
  .carta-intro h2 { font-size: 34px; }
  .menu-grid { grid-template-columns: 1fr; }
  .plato-photo { height: 220px; }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
