/* cafesoft.css — Identidad visual: paleta café, tipografía del sistema (legible y funciona sin internet),
   objetivos táctiles grandes (mín. 48px) para uso rápido en mostrador. */

/* Variables de color: se cambian aquí y afectan todo el sistema (consistencia visual). */
:root {
  --cs-espresso: #2b1a12;   /* fondo del menú */
  --cs-roast: #4a2c1d;      /* hover del menú */
  --cs-caramel: #c8782f;    /* color de acción principal */
  --cs-caramel-dark: #a5611f;
  --cs-cream: #f7f0e6;      /* fondo general */
  --cs-milk: #fffaf3;       /* fondo de tarjetas */
  --cs-leaf: #3f7d58;       /* éxito / cobrar */
  --cs-text: #2b1a12;
  /* Sobrescribimos variables de Bootstrap para que sus componentes usen nuestra paleta. */
  --bs-body-bg: var(--cs-cream);
  --bs-body-color: var(--cs-text);
  --bs-primary: var(--cs-caramel);
  --bs-primary-rgb: 200, 120, 47;
  --bs-link-color: var(--cs-caramel-dark);
  --bs-border-radius: .75rem;
}
/* Tipografía del sistema: sans-serif nítida en pantalla, tamaño base 16px+. */
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 1.02rem; background: var(--cs-cream); }

/* ---------- Estructura: menú lateral + contenido ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex: none; background: var(--cs-espresso); color: #f3e6d8; display: flex; flex-direction: column; padding: 1rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: 1.6rem; font-weight: 700; padding: .4rem .6rem 1.2rem; }
.brand i { font-size: 2.2rem; color: var(--cs-caramel); }
.nav-lateral { display: flex; flex-direction: column; gap: .3rem; flex: 1; overflow-y: auto; }
.nav-lateral a { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: .8rem; color: #e9d9c8; text-decoration: none; font-weight: 500; min-height: 52px; position: relative; }
.nav-lateral a i { font-size: 1.6rem; width: 1.9rem; text-align: center; }
.nav-lateral a:hover { background: var(--cs-roast); color: #fff; }
.nav-lateral a.activo { background: var(--cs-caramel); color: #fff; }
.globo { margin-left: auto; background: #d9382c; color: #fff; font-style: normal; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; }
.sidebar-pie { border-top: 1px solid #5b3c2b; padding-top: 1rem; display: grid; gap: .8rem; }
.quien { display: flex; gap: .6rem; align-items: center; }
.quien i { font-size: 2rem; }
.quien small { display: block; color: #c9b39e; }
.contenido { flex: 1; padding: 1.5rem 2rem 3rem; min-width: 0; }
.contenido-solo { max-width: 460px; margin: 6vh auto; padding: 0 1rem; }

/* ---------- Tarjetas y encabezados ---------- */
.card { background: var(--cs-milk); border: 1px solid #ead9c6; box-shadow: 0 2px 8px rgba(43,26,18,.06); }
.card-header { background: #f1e3d1; font-weight: 700; border-bottom: 1px solid #ead9c6; }
h1.titulo { font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; }
h1.titulo i { color: var(--cs-caramel); font-size: 2.2rem; }

/* Botones de la marca (mismo color y posición en todas las pantallas). */
.btn { min-height: 44px; font-weight: 600; }
.btn-cafe { background: var(--cs-caramel); border-color: var(--cs-caramel); color: #fff; }
.btn-cafe:hover { background: var(--cs-caramel-dark); border-color: var(--cs-caramel-dark); color: #fff; }
.btn-cobrar { background: var(--cs-leaf); border-color: var(--cs-leaf); color: #fff; font-size: 1.4rem; min-height: 68px; }
.btn-cobrar:hover:not(:disabled) { background: #316547; color: #fff; }
.form-control, .form-select { min-height: 46px; }
.form-label { font-weight: 600; }

/* ---------- POS: categorías y mosaicos de producto (iconos grandes) ---------- */
.cats { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cat-btn { border: 2px solid #e0c9ad; background: var(--cs-milk); border-radius: 1rem; padding: .6rem 1.1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; min-height: 56px; color: var(--cs-text); }
.cat-btn .emo { font-size: 1.7rem; }
.cat-btn.activo { background: var(--cs-caramel); border-color: var(--cs-caramel); color: #fff; }
.grid-prod { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .9rem; }
.prod { border: 2px solid #ead9c6; background: var(--cs-milk); border-radius: 1.1rem; padding: .9rem .6rem; text-align: center; cursor: pointer; transition: transform .08s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; align-items: center; gap: .15rem; min-height: 168px; color: var(--cs-text); }
.prod:hover:not(:disabled) { border-color: var(--cs-caramel); box-shadow: 0 6px 16px rgba(200,120,47,.25); }
.prod:active:not(:disabled) { transform: scale(.96); }
.prod .emo { font-size: 2.8rem; line-height: 1.1; }
.prod .nom { font-weight: 700; line-height: 1.15; }
.prod .pre { font-size: 1.35rem; font-weight: 800; color: var(--cs-caramel-dark); }
.prod .disp { font-size: .82rem; color: #7a6350; }
.prod.poco { border-color: #e3a72f; }
.prod:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Ticket del POS ---------- */
.ticket-panel { position: sticky; top: 1rem; }
.linea { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed #dcc7ae; }
.linea .nom { font-weight: 600; }
.cant-ctl { display: inline-flex; align-items: center; gap: .4rem; }
.cant-ctl button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--cs-caramel); background: #fff; font-size: 1.4rem; font-weight: 700; line-height: 1; color: var(--cs-caramel-dark); }
.cant-ctl button:hover { background: var(--cs-caramel); color: #fff; }
.cant-ctl b { min-width: 1.8rem; text-align: center; font-size: 1.2rem; }
.total-grande { font-size: 2.4rem; font-weight: 800; }
.rapidos { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.rapidos button { min-height: 48px; }

/* Resultado del cambio: color + texto (no solo color) para accesibilidad. */
.cambio-ok { color: var(--cs-leaf); font-weight: 800; }
.cambio-falta { color: #c0392b; font-weight: 800; }

/* ---------- Ticket impreso ---------- */
.ticket-papel { max-width: 380px; margin: 0 auto; background: #fff; padding: 1.5rem; border: 1px dashed #bda88f; font-family: "Courier New", monospace; }
.ticket-papel table { width: 100%; }
.ticket-papel td { padding: .15rem 0; vertical-align: top; }

/* Tablas y estados */
.table > :not(caption) > * > * { padding: .75rem .7rem; }
.badge-estado { font-size: .85rem; }
.stat { font-size: 1.9rem; font-weight: 800; }

/* ---------- Impresión: ocultar menú y botones ---------- */
@media print {
  .sidebar, .no-print, .alert { display: none !important; }
  .contenido { padding: 0; }
  body { background: #fff; }
}

/* ---------- Tablet / móvil: el menú pasa arriba en horizontal ---------- */
@media (max-width: 991px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: .5rem; overflow-x: auto; padding: .5rem; }
  .brand { padding: 0 .6rem 0 0; font-size: 1.2rem; }
  .brand span, .sidebar-pie .quien { display: none; }
  .nav-lateral { flex-direction: row; overflow-x: auto; }
  .nav-lateral a { flex-direction: column; gap: 0; min-height: 60px; font-size: .75rem; padding: .4rem .6rem; text-align: center; }
  .sidebar-pie { border: 0; padding: 0; }
  .contenido { padding: 1rem; }
  .ticket-panel { position: static; }
}
