/* POS Healthy Food Casino — estilos sin dependencias de compilación */
:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #1d1b18;
  --muted: #6b665e;
  --line: #e3dfd7;
  --brand: #c2410c;
  --brand-ink: #ffffff;
  --brand-soft: #fff1e8;
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --warn-soft: #fff7d6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 16px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* Barra superior */
.topbar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.topbar .brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: .02em; margin-right: .5rem; color: #fff; text-decoration: none; }
.topbar .brand-logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #fff; }
.topbar .brand-logo img { width: 30px; height: auto; display: block; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.topbar nav a { color: #e9e5dd; text-decoration: none; padding: .6rem .9rem; border-radius: 8px; font-weight: 500; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar .who { font-size: .875rem; color: #cfc9bf; }
.topbar form button { background: transparent; border: 1px solid #5b5650; color: #fff; border-radius: 8px; padding: .45rem .8rem; cursor: pointer; }
.shift-pill { font-size: .8rem; padding: .25rem .6rem; border-radius: 999px; background: #3a3631; color: #fff; }
.shift-pill.open { background: var(--ok); }

main.page { padding: 1rem; max-width: 1400px; margin: 0 auto; }

/* Tarjetas, botones, formularios */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; user-select: none; }
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.lg { min-height: 60px; font-size: 1.15rem; padding: .8rem 1.4rem; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
.btn.selected { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 44px; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 22px; height: 22px; }
.field-error { color: var(--bad); font-size: .875rem; margin-top: .25rem; }
.alert { padding: .75rem 1rem; border-radius: 10px; border: 1px solid; }
.alert.error { background: var(--bad-soft); border-color: #f3c4c4; color: #7f1d1d; }
.alert.success { background: var(--ok-soft); border-color: #b9e3c6; color: #14532d; }
.alert.warn { background: var(--warn-soft); border-color: #f0dc8a; color: #6b4f00; }

table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover, .table tr.is-selected { background: var(--brand-soft); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #b9e3c6; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: #f3c4c4; }
.badge.brand { background: var(--brand-soft); color: var(--brand); border-color: #f6c9ad; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .k { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Pantalla de venta */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .pos { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 760px) { .pos { grid-template-columns: 1fr; } }
.cats { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.cats .btn { min-height: 54px; font-size: 1.05rem; padding: .5rem 1.2rem; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.product { display: flex; flex-direction: column; justify-content: space-between; min-height: 110px; padding: .9rem; text-align: left; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font: inherit; cursor: pointer; color: var(--ink); }
.product:hover { border-color: var(--brand); }
.product .name { font-weight: 700; font-size: 1.05rem; }
.product .price { font-weight: 700; color: var(--brand); font-size: 1.1rem; }
.product .tag { font-size: .75rem; color: var(--muted); }
.product.soldout { opacity: .5; cursor: not-allowed; background: var(--surface-2); }
.product.soldout .price { color: var(--muted); text-decoration: line-through; }

.cart { position: sticky; top: 70px; display: flex; flex-direction: column; max-height: calc(100vh - 86px); }
.cart-lines { overflow-y: auto; flex: 1; margin: 0 -1rem; padding: 0 1rem; }
.line { padding: .65rem 0; border-bottom: 1px solid var(--line); }
.line.has-error { background: var(--bad-soft); margin: 0 -1rem; padding: .65rem 1rem; }
.line .title { font-weight: 700; }
.line .opts { font-size: .875rem; color: var(--muted); }
.line .note { font-size: .875rem; color: #7c2d12; font-style: italic; }
.line .errors { color: var(--bad); font-size: .875rem; font-weight: 600; margin-top: .25rem; }
.qty { display: inline-flex; align-items: center; gap: .25rem; }
.qty .btn { min-width: 44px; padding: 0; }
.qty span { min-width: 2ch; text-align: center; font-weight: 700; }
.total-row { display: flex; justify-content: space-between; font-size: 1.6rem; font-weight: 800; padding: .75rem 0; font-variant-numeric: tabular-nums; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.methods .btn { min-height: 56px; }
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.change { font-size: 1.3rem; font-weight: 800; color: var(--ok); }
.change.neg { color: var(--bad); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,18,15,.45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 620px; padding: 1.25rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.opt-group { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.opt-grid .btn { min-height: 58px; flex-direction: column; gap: 0; }
.opt-grid .btn small { font-weight: 500; font-size: .8rem; }

.success-box { text-align: center; padding: 1.5rem 1rem; }
.success-box .folio { font-size: 2.2rem; font-weight: 800; letter-spacing: .05em; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-wrap .card { width: 100%; max-width: 380px; }

/* Logo en ingreso */
.login-logo { display: block; width: 200px; max-width: 70%; height: auto; margin: 0 auto .25rem; }
@media (max-width: 960px) { .topbar .brand-name { display: none; } .topbar .who { display: none; } }
@media (max-width: 760px) {
  .topbar { flex-wrap: nowrap; gap: .5rem; padding: .4rem .6rem; }
  .topbar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; padding: .55rem .7rem; }
  .shift-pill { display: none; }
}

/* ============================================================
   Mesas: tarjetas limpias. Colores del logo para los estados.
   ============================================================ */
:root { --hf-teal: #1fae9b; --hf-yellow: #eea72f; --hf-coral: #ef5d3d; }

.mt-bar { gap: .75rem; }
.mt-tabs, .mt-filters { display: flex; gap: .35rem; flex-wrap: wrap; }
.mt-tabs button, .mt-filters button { font: inherit; font-weight: 600; cursor: pointer; min-height: 40px; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.mt-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mt-tabs button span { margin-left: .4rem; display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .3em; border-radius: 999px; background: var(--hf-coral); color: #fff; font-size: .75rem; }
.mt-filters button { border-color: transparent; background: transparent; color: var(--muted); }
.mt-filters button.on { background: var(--surface); border-color: var(--line); color: var(--ink); }

.mt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.mt-card { position: relative; display: flex; flex-direction: column; gap: .15rem; min-height: 112px; padding: .9rem 1rem .9rem 1.15rem; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.mt-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: transparent; }
.mt-card:hover { border-color: #cfc8bc; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.mt-card:disabled { opacity: .5; cursor: not-allowed; }
.mt-name { font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.mt-total { font-weight: 700; font-size: 1.05rem; }
.mt-meta { margin-top: auto; font-size: .8rem; color: var(--muted); }
.mt-card.is-free .mt-name { color: #8a847b; }
.mt-card.is-busy::before, .mt-card.is-empty::before { background: var(--hf-coral); }
.mt-card.is-late::before { background: var(--hf-yellow); }
.mt-card.is-bill::before { background: var(--hf-teal); }
.mt-card.is-empty::before { background: repeating-linear-gradient(180deg, var(--hf-coral) 0 6px, transparent 6px 10px); }
.mt-card.is-bill .mt-meta { color: var(--hf-teal); font-weight: 600; }
.mt-card.is-late .mt-meta { color: #a8730f; font-weight: 600; }

.mt-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--muted); }
.mt-legend i { display: inline-block; width: 4px; height: 12px; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.mt-legend i.is-busy { background: var(--hf-coral); }
.mt-legend i.is-late { background: var(--hf-yellow); }
.mt-legend i.is-bill { background: var(--hf-teal); }

/* Selector de caja */
.reg-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.reg { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-width: 170px; padding: .6rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); text-align: left; }
.reg small { color: var(--muted); font-size: .8rem; }
.reg.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dot-open, .dot-closed { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .2rem; }
.dot-open { background: var(--ok); }
.dot-closed { background: #b9b2a7; }
