:root {
  --ink: #1a1a1a;
  --naranja: #ea580c;
  --naranja-dark: #c2410c;
  --amarillo: #fbbf24;
  --crema: #fef3c7;
  --paper: #fffbeb;
  --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(--naranja) 0%, var(--naranja-dark) 100%); color: white; }
.top-inner, .wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; min-width: 0; }
.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; }
.logo small { display: block; font-weight: 400; font-size: 11px; opacity: 0.9; letter-spacing: 0.1em; text-transform: uppercase; }
.top nav { display: flex; gap: 16px; align-items: center; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { text-decoration: none; }
.btn { display: inline-block; background: var(--crema); color: var(--naranja-dark); 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(234, 88, 12, 0.2); }
.btn:hover { background: #fef08a; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(234, 88, 12, 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(234, 88, 12, 0.15); background: #f4e8d8; }
.hero-photo img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; display: block; }
.kicker { color: var(--naranja); 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; }

.produccion-card { background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(234, 88, 12, 0.15); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.produccion-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(234, 88, 12, 0.2); }
.prod-img { height: 120px; overflow: hidden; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.produccion-card:hover .prod-img img { transform: scale(1.05); }
.prod-body { padding: 20px; }
.produccion-card h3 { margin: 0 0 12px; font-size: 16px; color: var(--naranja); }
.produccion-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.produccion-item:last-child { border: 0; }
.produccion-item .cant { font-weight: 700; color: var(--naranja); }

.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(--naranja); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.modules article:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(234, 88, 12, 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(--naranja); }
.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: var(--crema); }
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.pendiente { background: #fef3c7; color: #92400e; }
.tag.preparando { background: #fed7aa; color: #c2410c; }
.tag.listo { background: #bbf7d0; color: #166534; }
.tag.entregado { background: #e5e7eb; color: #374151; }
.tag.cancelado { background: #fee2e2; color: #991b1b; }
.tag.mostrador { background: #dbeafe; color: #1e40af; }
.tag.delivery { background: #fce7f3; color: #be185d; }

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(--naranja); border-bottom-color: var(--naranja); }
.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], .create[hidden] { display: none !important; }
.stats input[type="text"] { margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; width: 200px; cursor: text; }
.prod-card { cursor: pointer; }
.prod-card.on { outline: 2px solid var(--naranja); }
.ing-row.on { background: var(--crema); }

.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(--naranja); }
.stats .on { border-color: var(--naranja); background: var(--crema); }

.workspace { display: grid; grid-template-columns: 1.3fr 0.7fr; 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: #fffbeb; }
.row.on { background: var(--crema); }

.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(--naranja); color: white; border: 0; padding: 10px 16px; border-radius: 4px; cursor: pointer; font-weight: 500; }
.btn-panel:hover { background: var(--naranja-dark); }

.items-pedido { margin: 12px 0; padding: 0; list-style: none; font-size: 13px; }
.items-pedido li { padding: 6px 0; border-bottom: 1px dotted var(--line); display: flex; justify-content: space-between; }

.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: var(--crema); border: 1px solid #fcd34d; border-radius: 6px; padding: 12px; margin: 12px 0; }
.arca-section h4 { margin: 0 0 8px; font-size: 13px; color: var(--naranja); }

.produccion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.prod-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; }
.prod-card .nombre { font-size: 13px; font-weight: 500; }
.prod-card .numeros { display: flex; justify-content: space-around; margin-top: 8px; font-size: 12px; }
.prod-card .num { font-size: 20px; font-weight: 700; }
.prod-card .num.verde { color: #16a34a; }
.prod-card .num.rojo { color: #dc2626; }

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

.card-photo { height: 160px; overflow: hidden; background: #f4e8d8; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.product-card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(234, 88, 12, 0.16); }
.product-card:hover .card-photo img { transform: scale(1.05); }

.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(234, 88, 12, 0.12); background: #e8eef2; isolation: isolate; }
.map-embed iframe, .map-canvas { position: relative; z-index: 1; width: 100%; height: 100%; border: 0; min-width: 0; display: block; background: transparent; }
.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(--naranja); }

.zona-line { margin: 8px 0 0; font-size: 15px; opacity: 0.95; }
.place-line { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

.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; font-weight: 700; color: var(--naranja); margin: 4px 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; }

.sucursal-bar { background: var(--crema); border: 1px solid #fcd34d; border-radius: 8px; padding: 10px 14px; font-size: 13px; max-width: 420px; }
.sucursal-bar strong { display: block; color: var(--naranja); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.sucursal-form { display: grid; gap: 8px; margin-top: 10px; }
.sucursal-form .actions { margin-top: 4px; }

.prod-card { overflow: hidden; padding: 0; text-align: left; }
.prod-card .card-photo { height: 110px; }
.prod-card .prod-card-body { padding: 12px; text-align: center; }
.prod-card:hover .card-photo img { transform: scale(1.05); }

.zona-box { background: #fce7f3; border: 1px solid #f9a8d4; border-radius: 6px; padding: 10px 12px; margin: 12px 0; font-size: 13px; }
.zona-box strong { display: block; color: #be185d; margin-bottom: 4px; }

.items-pedido li { align-items: center; gap: 8px; }
.items-pedido img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.items-pedido .item-txt { flex: 1; }

@media (max-width: 960px) {
  .hero, .modules, .ubicacion-grid, .workspace, .produccion-grid { grid-template-columns: 1fr; }
  .top-inner, .toolbar { flex-direction: column; align-items: start; }
  .top nav { justify-content: flex-start; }
  .hero-photo img { min-height: 200px; }
  h1 { font-size: 32px; }
}

/* 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;
}
