/* =========================================================================
   Comandas Café — estilos
   Marca: navy #0A213C · lima #6DC14B · Baloo 2 (display) + Inter (texto)
   Principio: legibilidad de reojo. El cronómetro es el elemento estrella.
   ========================================================================= */

:root {
  --navy: #0a213c;
  --navy-700: #0e2b4d;
  --navy-600: #143a68;
  --lime: #6dc14b;
  --lime-600: #57a53a;
  --cream: #f5f1e8;
  --paper: #ffffff;
  --ink: #0a213c;
  --muted: #6b7a90;

  /* Estados del cronómetro (envejecimiento de la comanda) */
  --ontime: #2fb96b;
  --warn: #f5a623;
  --late: #ff453a;

  --radius: 16px;
  --radius-pill: 999px;
  --shadow: 0 6px 24px rgba(10, 33, 60, 0.12);
  --font-display: 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: var(--font-display); }

button { font-family: inherit; cursor: pointer; }

.pill {
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 24px;
  font-weight: 700;
  font-size: 16px;
  background: var(--lime);
  color: var(--navy);
  transition: transform 0.06s ease, filter 0.15s ease;
}
.pill:hover { filter: brightness(1.05); }
.pill:active { transform: scale(0.97); }
.pill:disabled { opacity: 0.5; cursor: not-allowed; }
.pill.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25); }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

/* ---- Login --------------------------------------------------------------- */

.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--navy-600), var(--navy) 60%);
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 40px 34px;
  text-align: center;
}
.login-card .logo { font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--navy); }
.login-card .logo span { color: var(--lime); }
.login-card .sub { color: var(--muted); margin: 4px 0 28px; font-size: 15px; }
.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 14px 16px; font-size: 16px;
  border: 2px solid #e5e7eb; border-radius: 12px; font-family: inherit;
}
.field input:focus { border-color: var(--lime); outline: none; }
.login-card .pill { width: 100%; margin-top: 6px; padding: 16px; font-size: 17px; }
.login-error { color: var(--late); font-size: 14px; min-height: 20px; margin-top: 12px; font-weight: 600; }
.login-hint { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.role-tabs button {
  flex: 1; padding: 10px; border-radius: var(--radius-pill); border: 2px solid #e5e7eb;
  background: #fff; font-weight: 700; color: var(--muted);
}
.role-tabs button.active { border-color: var(--navy); background: var(--navy); color: #fff; }

/* ---- Barra superior común ------------------------------------------------ */

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px; color: #fff; background: var(--navy);
}
.topbar .brand { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.topbar .brand span { color: var(--lime); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; opacity: 0.85; }
.topbar .logout { font-size: 13px; color: #fff; background: transparent; border: none; text-decoration: underline; opacity: 0.8; }

/* =========================================================================
   MESERO — bloc de notas cálido para tomar la comanda
   ========================================================================= */

.mesero { background: var(--cream); min-height: 100%; }
.mesero .layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 20px;
  padding: 20px; max-width: 1200px; margin: 0 auto;
}
.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-tabs button {
  padding: 10px 18px; border-radius: var(--radius-pill); border: 2px solid transparent;
  background: #fff; font-weight: 700; color: var(--navy); box-shadow: var(--shadow);
}
.cat-tabs button.active { background: var(--navy); color: #fff; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.menu-item {
  background: #fff; border: none; border-radius: var(--radius); padding: 18px 14px;
  text-align: left; box-shadow: var(--shadow); transition: transform 0.06s ease;
}
.menu-item:active { transform: scale(0.97); }
.menu-item .name { font-weight: 700; font-size: 16px; color: var(--navy); }
.menu-item .price { color: var(--muted); font-size: 14px; margin-top: 4px; }

.ticket {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow);
  padding: 20px; align-self: start; position: sticky; top: 20px;
}
.ticket h2 { margin: 0 0 12px; font-size: 20px; color: var(--navy); }
.ticket .mesa-field input {
  width: 100%; padding: 12px 14px; font-size: 16px; border: 2px solid #e5e7eb;
  border-radius: 12px; margin-bottom: 14px; font-family: inherit;
}
.ticket-lines { list-style: none; margin: 0 0 14px; padding: 0; max-height: 46vh; overflow-y: auto; }
.ticket-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #e5e7eb; }
.ticket-line .ln-name { flex: 1; font-weight: 600; font-size: 15px; }
.ticket-line .qty { display: flex; align-items: center; gap: 8px; }
.ticket-line .qty button {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--navy);
  background: #fff; color: var(--navy); font-weight: 800; font-size: 16px; line-height: 1;
}
.ticket-line .qty span { min-width: 22px; text-align: center; font-weight: 800; }
.ticket-empty { color: var(--muted); text-align: center; padding: 30px 0; }
.ticket .send { width: 100%; padding: 18px; font-size: 18px; }

.my-orders { margin-top: 18px; }
.my-orders h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }
.mini-order { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; border-top: 1px solid #f0efe9; }
.mini-order .folio { font-family: var(--font-display); font-weight: 800; color: var(--navy); }
.badge { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-pill); }
.badge.pendiente { background: #fff2d6; color: #9a6a00; }
.badge.aceptada  { background: #dbe9ff; color: #1c4e9a; }
.badge.lista     { background: #d9f5e3; color: #1c7a45; }

/* =========================================================================
   BARRA — pantalla oscura de línea, legible de lejos
   ========================================================================= */

.barra { background: var(--navy); min-height: 100%; color: #fff; }
.barra .metrics {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 22px;
  background: var(--navy-700); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.metric {
  background: rgba(255,255,255,0.05); border-radius: 12px; padding: 10px 16px; min-width: 120px;
}
.metric .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.6; }
.metric .v { font-family: var(--font-display); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }

.board { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; align-items: start; }
.lane h2 {
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75;
  margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
}
.lane h2 .count { background: rgba(255,255,255,0.12); border-radius: var(--radius-pill); padding: 2px 12px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lane-empty { opacity: 0.4; padding: 30px; text-align: center; border: 2px dashed rgba(255,255,255,0.12); border-radius: var(--radius); }

.card {
  background: var(--paper); color: var(--ink); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); border-top: 6px solid var(--ontime);
  animation: pop 0.25s ease;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.card.state-warn { border-top-color: var(--warn); }
.card.state-late { border-top-color: var(--late); }
.card.state-late.pending { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.0); }
  50% { box-shadow: 0 0 0 5px rgba(255, 69, 58, 0.35); }
}

.card .head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.card .folio { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--navy); }
.card .mesa { font-size: 14px; color: var(--muted); font-weight: 600; }

/* Elemento estrella: el cronómetro vivo */
.timer {
  font-family: var(--font-body); font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 30px; line-height: 1; letter-spacing: 0.01em;
  color: var(--ontime); margin: 8px 0 12px;
}
.timer.state-warn { color: var(--warn); }
.timer.state-late { color: var(--late); }
.timer .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; display: block; color: var(--muted); }

.card .items { list-style: none; margin: 0 0 14px; padding: 0; }
.card .items li { display: flex; gap: 8px; padding: 4px 0; font-size: 16px; }
.card .items .q { font-weight: 800; color: var(--navy); min-width: 26px; }
.card .items .note { color: var(--warn); font-size: 13px; font-style: italic; }
.card .actions button { width: 100%; padding: 14px; font-size: 16px; }
.card .actions .accept { background: var(--lime); }
.card .actions .ready { background: var(--navy); color: #fff; }

/* Botón de activar sonido / iniciar turno */
.sound-gate {
  position: fixed; inset: 0; background: rgba(10,33,60,0.94); z-index: 50;
  display: grid; place-items: center; text-align: center; color: #fff; padding: 24px;
}
.sound-gate .box { max-width: 420px; }
.sound-gate h2 { font-size: 26px; margin: 0 0 8px; }
.sound-gate p { opacity: 0.8; margin: 0 0 24px; line-height: 1.6; }
.sound-gate .pill { padding: 18px 40px; font-size: 18px; }

/* Banner de nueva comanda */
.banner {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--lime); color: var(--navy); font-weight: 800;
  padding: 12px 26px; border-radius: var(--radius-pill); box-shadow: var(--shadow);
  z-index: 40; animation: drop 0.3s ease;
}
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 14px 24px; border-radius: var(--radius-pill);
  font-weight: 700; box-shadow: var(--shadow); z-index: 60; animation: drop 0.3s ease;
}

@media (max-width: 820px) {
  .mesero .layout { grid-template-columns: 1fr; }
  .ticket { position: static; }
  .board { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

/* =========================================================================
   FASE 2 — fotos, modales, modificadores y panel de administrador
   ========================================================================= */

.pill.small { padding: 10px 16px; font-size: 14px; }
.pill.tiny { padding: 7px 12px; font-size: 13px; }

/* ---- Mesero: producto con foto ------------------------------------------ */
.menu-item.has-photo, .menu-item { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.menu-item .thumb {
  width: 100%; height: 96px; background-size: cover; background-position: center;
  background-color: #e9efe4; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--lime-600);
}
.menu-item .thumb.placeholder { background: linear-gradient(135deg, #eef4ea, #dcebd3); }
.menu-item .mi-body { padding: 12px 14px; }
.menu-item .has-mods {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700;
  color: var(--lime-600); background: #eef7e9; padding: 2px 8px; border-radius: var(--radius-pill);
}

/* Cart: modificadores y notas por línea */
.ticket-line .ln-mods { font-size: 12.5px; color: var(--lime-600); font-weight: 600; margin-top: 2px; }
.ticket-line .ln-note { font-size: 12px; color: #b8860b; margin-top: 2px; }

/* ---- Modales (compartido) ----------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 33, 60, 0.55); z-index: 100;
  display: grid; place-items: center; padding: 18px; animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; color: var(--ink); border-radius: 22px; width: min(460px, 100%);
  max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(10, 33, 60, 0.35);
  animation: pop 0.2s ease;
}
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 8px; }
.modal-head h2 { margin: 0; font-size: 22px; color: var(--navy); }
.modal-close { border: none; background: #f0f2f5; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; color: var(--muted); }
.modal-desc { margin: 0 22px 8px; color: var(--muted); font-size: 14px; }
.modal-body { padding: 8px 22px 16px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 22px 20px; border-top: 1px solid #f0f2f5; }
.modal-foot.between { justify-content: space-between; }

/* ---- Selector de modificadores (mesero) --------------------------------- */
.mod-group { margin-bottom: 18px; }
.mod-title { font-weight: 800; color: var(--navy); font-size: 15px; margin-bottom: 8px; }
.mod-hint { font-weight: 600; font-size: 12px; color: var(--muted); margin-left: 8px; }
.mod-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-chip {
  border: 2px solid #e5e7eb; background: #fff; border-radius: var(--radius-pill);
  padding: 10px 16px; font-weight: 700; font-size: 14px; color: var(--navy);
}
.mod-chip.on { border-color: var(--lime); background: var(--lime); color: var(--navy); }
.mod-chip .delta { margin-left: 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.mod-chip.on .delta { color: var(--navy); }
.qty.big button { width: 40px; height: 40px; font-size: 20px; }
.qty.big .q-val { min-width: 30px; text-align: center; font-weight: 800; font-size: 18px; }

/* ---- Barra: modificadores en la comanda --------------------------------- */
.card .items .it { display: flex; flex-direction: column; }
.card .items .mods { font-size: 13px; color: var(--lime-600); font-weight: 700; margin-top: 1px; }
.card .items .note { color: #b8860b; font-size: 12.5px; font-style: italic; margin-top: 1px; }

/* ---- Panel admin -------------------------------------------------------- */
.admin { background: var(--cream); min-height: 100%; }
.topbar .tag { background: var(--lime); color: var(--navy); font-weight: 800; font-size: 12px; padding: 3px 10px; border-radius: var(--radius-pill); }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-head h1 { font-size: 30px; color: var(--navy); margin: 0; }
.admin-sub { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-filters button {
  padding: 8px 16px; border-radius: var(--radius-pill); border: 2px solid transparent;
  background: #fff; font-weight: 700; color: var(--navy); box-shadow: var(--shadow); font-size: 14px;
}
.admin-filters button.active { background: var(--navy); color: #fff; }
.admin-empty { color: var(--muted); text-align: center; padding: 40px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.product-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.product-card.inactive { opacity: 0.6; }
.product-card .p-thumb {
  height: 130px; background-size: cover; background-position: center; background-color: #e9efe4;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 40px; color: var(--lime-600);
}
.product-card .p-thumb.placeholder { background: linear-gradient(135deg, #eef4ea, #dcebd3); }
.product-card .p-body { padding: 14px 16px; flex: 1; }
.product-card .p-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.product-card .p-name { font-weight: 800; color: var(--navy); font-size: 17px; }
.product-card .p-price { font-family: var(--font-display); font-weight: 800; color: var(--navy); }
.product-card .p-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.product-card .p-cat, .product-card .p-mods, .product-card .p-off {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill);
}
.product-card .p-cat { background: #eef2f7; color: var(--muted); }
.product-card .p-mods { background: #eef7e9; color: var(--lime-600); }
.product-card .p-off { background: #ffe0dd; color: var(--late); }
.product-card .p-actions { display: flex; gap: 6px; padding: 12px 16px; border-top: 1px solid #f0f2f5; }
.product-card .p-actions button { flex: 1; border: 2px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 9px; font-weight: 700; font-size: 13px; color: var(--navy); }
.product-card .p-actions .del { flex: 0 0 auto; width: 42px; color: var(--late); border-color: #ffd6d1; }

/* ---- Editor de producto ------------------------------------------------- */
.editor-grid { display: grid; grid-template-columns: 180px 1fr; gap: 20px; margin-bottom: 20px; }
.photo-col { display: flex; flex-direction: column; gap: 10px; }
.photo-preview {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius); background-size: cover; background-position: center;
  background-color: #eef2f0; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 14px;
  border: 2px dashed #d6ddd2;
}
.photo-preview.empty { border-style: dashed; }
.url-input { padding: 9px 12px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 12.5px; font-family: inherit; }
.fields-col { display: flex; flex-direction: column; gap: 12px; }
.fields-col label, .mods-editor label { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; color: var(--muted); gap: 5px; }
.fields-col input, .fields-col textarea {
  padding: 11px 13px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 15px; font-family: inherit; color: var(--ink); font-weight: 500;
}
.fields-col .two { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }

.mods-editor { border-top: 1px solid #f0f2f5; padding-top: 16px; }
.mods-editor-head { display: flex; align-items: center; justify-content: space-between; }
.mods-editor-head h3 { margin: 0; font-size: 17px; color: var(--navy); }
.mods-hint { color: var(--muted); font-size: 12.5px; margin: 4px 0 12px; }
.mod-group-edit { background: #f7f9f6; border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.mge-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.mge-head .g-name { flex: 1; min-width: 140px; padding: 9px 12px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 14px; font-family: inherit; font-weight: 600; }
.mge-head .g-type { padding: 9px 10px; border: 2px solid #e5e7eb; border-radius: 10px; font-family: inherit; font-weight: 600; font-size: 13px; }
.mge-head .g-req { flex-direction: row; align-items: center; gap: 5px; font-size: 13px; color: var(--navy); font-weight: 700; }
.mge-head .g-del, .opt-row .o-del { border: none; background: #fff; color: var(--late); width: 30px; height: 30px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); }
.g-options { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; }
.opt-row .o-name { flex: 1; padding: 8px 11px; border: 2px solid #e5e7eb; border-radius: 9px; font-size: 14px; font-family: inherit; }
.opt-row .o-delta { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); font-weight: 700; }
.opt-row .o-price { width: 62px; padding: 8px 8px; border: 2px solid #e5e7eb; border-radius: 9px; font-size: 14px; font-family: inherit; }
.active-toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); font-size: 14px; }
.active-toggle input { width: 18px; height: 18px; }

@media (max-width: 620px) {
  .editor-grid { grid-template-columns: 1fr; }
  .photo-preview { max-width: 200px; }
}

/* =========================================================================
   FASE 3 — indicaciones, total, cobro y reportes
   ========================================================================= */

/* Mesero: indicaciones del pedido y total */
.order-notes {
  width: 100%; margin: 6px 0 10px; padding: 10px 12px; border: 2px solid #e5e7eb;
  border-radius: 12px; font-family: inherit; font-size: 14px; resize: vertical;
}
.order-notes:focus { border-color: var(--lime); outline: none; }
.ticket-total {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display); font-weight: 800; color: var(--navy);
  font-size: 20px; padding: 6px 2px 12px;
}
.ticket-line .ln-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ticket-line .ln-total { font-weight: 800; color: var(--navy); font-size: 14px; font-variant-numeric: tabular-nums; }
.ln-note-btn { display: inline-block; margin-top: 4px; background: none; border: none; color: var(--lime-600); font-weight: 700; font-size: 12px; padding: 0; }

/* Modal: indicaciones especiales por producto */
.special-label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--muted); font-size: 13px; margin-top: 6px; }
.special { padding: 10px 12px; border: 2px solid #e5e7eb; border-radius: 10px; font-family: inherit; font-size: 14px; resize: vertical; }
.special:focus { border-color: var(--lime); outline: none; }

/* Mini-order con cobro */
.mini-order .mo-mesa { flex: 1; }
.mini-order .mo-right { margin-left: auto; }
.mini-order .cobrar-btn { background: var(--lime); color: var(--navy); border: none; border-radius: var(--radius-pill); padding: 6px 14px; font-weight: 800; font-size: 13px; }
.mini-order .paid-tag { font-size: 12.5px; font-weight: 700; color: #1c7a45; background: #d9f5e3; padding: 4px 10px; border-radius: var(--radius-pill); }

/* Checkout (cerrar cuenta) */
.co-mesa { font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.co-lines { border-top: 1px dashed #e5e7eb; margin-bottom: 8px; }
.co-line { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed #e5e7eb; }
.co-line .co-qty { font-weight: 800; color: var(--navy); }
.co-line .co-name { flex: 1; font-size: 14px; }
.co-line .co-mods { color: var(--lime-600); font-weight: 600; }
.co-line .co-sub { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.co-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--navy); padding: 12px 0; }
.pay-label { font-weight: 700; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.pay-opts { display: flex; gap: 10px; }
.pay-chip { flex: 1; padding: 14px; border: 2px solid #e5e7eb; background: #fff; border-radius: 12px; font-weight: 800; font-size: 15px; color: var(--navy); }
.pay-chip.on { border-color: var(--lime); background: var(--lime); color: var(--navy); }
.cobrar-confirm { width: 100%; }

/* Barra: indicaciones del pedido */
.card .order-note { background: #fff6e0; color: #9a6a00; font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 10px; margin-bottom: 8px; }

/* ---- Admin: navegación y reportes --------------------------------------- */
.admin-nav { display: flex; gap: 6px; padding: 0 20px; background: var(--navy); }
.admin-nav button {
  padding: 14px 20px; background: none; border: none; color: rgba(255,255,255,0.6);
  font-weight: 800; font-size: 15px; border-bottom: 3px solid transparent;
}
.admin-nav button.active { color: #fff; border-bottom-color: var(--lime); }
.date-input { padding: 10px 14px; border: 2px solid #e5e7eb; border-radius: 12px; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--navy); background: #fff; }

.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.report-cards.secondary { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 24px; }
.report-metric { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.report-metric .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.report-metric .v { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--navy); font-variant-numeric: tabular-nums; margin-top: 4px; }

.report-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.report-table { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.report-table h3 { margin: 0 0 12px; font-size: 16px; color: var(--navy); }
.report-table table { width: 100%; border-collapse: collapse; }
.report-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid #f0f2f5; }
.report-table td { padding: 9px 0; border-bottom: 1px solid #f5f6f8; font-size: 14px; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table td.muted { color: var(--muted); text-align: center; }
.report-foot { color: var(--muted); font-size: 12.5px; margin-top: 16px; }

@media (max-width: 720px) {
  .report-tables { grid-template-columns: 1fr; }
}

/* =========================================================================
   FASE 4 — historial del mesero y reportes por rango + descarga
   ========================================================================= */

/* Mesero: encabezado, resumen e historial */
.mo-header { display: flex; align-items: center; justify-content: space-between; }
.link-btn { background: none; border: none; color: var(--lime-600); font-weight: 800; font-size: 13px; padding: 0; }
.mo-summary { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid #f0efe9; }
.mo-summary .mo-sum-total { font-weight: 800; color: var(--navy); }

.hist-summary { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.hist-summary b { color: var(--navy); }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-row { border: 1px solid #eef0ee; border-radius: 12px; padding: 12px 14px; }
.hist-top { display: flex; align-items: center; gap: 10px; }
.hist-top .hist-mesa { flex: 1; font-weight: 700; color: var(--navy); }
.hist-top .hist-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hist-items { color: #444; font-size: 14px; margin-top: 6px; }
.hist-note { color: #9a6a00; font-size: 13px; margin-top: 4px; }

/* Admin: controles de reportes */
.report-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.date-range { display: flex; gap: 12px; }
.date-range label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.range-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.range-presets button { padding: 8px 14px; border-radius: var(--radius-pill); border: 2px solid #e5e7eb; background: #fff; font-weight: 700; font-size: 13px; color: var(--navy); }
.range-presets button:hover { border-color: var(--lime); }
#downloadXlsx { margin-left: auto; }

@media (max-width: 640px) {
  .report-controls { align-items: stretch; }
  #downloadXlsx { margin-left: 0; }
}

/* =========================================================================
   FASE 5 — gestión de usuarios
   ========================================================================= */
.user-list { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.user-card { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.user-card.inactive { opacity: 0.6; }
.user-card .u-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: var(--navy); color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
}
.user-card .u-body { flex: 1; min-width: 0; }
.user-card .u-name { font-weight: 800; color: var(--navy); font-size: 16px; }
.user-card .u-you { font-size: 11px; font-weight: 800; color: var(--lime-600); background: #eef7e9; padding: 2px 8px; border-radius: var(--radius-pill); margin-left: 6px; }
.user-card .u-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; align-items: center; }
.user-card .u-user { font-size: 13px; color: var(--muted); font-weight: 600; }
.user-card .u-role { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-pill); }
.user-card .u-role.role-admin { background: #e5ddff; color: #5b3ea8; }
.user-card .u-role.role-barra { background: #dbe9ff; color: #1c4e9a; }
.user-card .u-role.role-mesero { background: #d9f5e3; color: #1c7a45; }
.user-card .u-off { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-pill); background: #ffe0dd; color: var(--late); }
.user-card .u-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.user-card .u-actions button { border: 2px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--navy); }
.user-card .u-actions .del { color: var(--late); border-color: #ffd6d1; }
.user-card .u-actions button:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 560px) {
  .user-card { flex-wrap: wrap; }
  .user-card .u-actions { width: 100%; }
  .user-card .u-actions button { flex: 1; }
}
