/* =========================================================
   POS Armadillo Naranja — Dashboard
   ========================================================= */

:root {
  /* Marca */
  --naranja: #F77F00;
  --naranja-claro: #FFC680;
  --naranja-suave: #FDEBD3;
  --carbon: #1C1C1C;
  --hueso: #F5F1EE;
  --blanco: #FFFFFF;

  /* Neutros derivados */
  --linea: #E6DED7;
  --texto: #1C1C1C;
  --texto-suave: #6B635C;
  --sidebar-texto: #CFC7C0;
  --sidebar-hover: #2A2A2A;

  /* Estados */
  --ok: #1F7A4D;      --ok-bg: #E3F1E8;
  --warn: #8A4B00;    --warn-bg: #FDEBD3;
  --error: #B42318;   --error-bg: #FBE4E1;

  /* Tipografía */
  --font: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Medidas */
  --sidebar-w: 272px;
  --sidebar-rail: 84px;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--hueso);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; border-radius: 8px; }

[hidden] { display: none !important; }

[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* =========================================================
   Layout
   ========================================================= */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  padding: 28px 32px 48px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.hero    { grid-column: span 8; }
.kpis    { grid-column: span 4; }
.mesas   { grid-column: span 7; }
.fe      { grid-column: span 5; }
.top     { grid-column: span 4; }
.stock   { grid-column: span 4; }
.pagos   { grid-column: span 4; }
.ventas  { grid-column: span 12; }

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--carbon);
  color: var(--sidebar-texto);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px 18px;
  transition: width .2s ease;
  z-index: 40;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 22px;
}

.sidebar__logo { display: block; }
.logo-full { width: 160px; height: auto; }
.logo-icon { display: none; width: 36px; height: auto; }

.icon-btn.sidebar__close { display: none; color: var(--blanco); }

.nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a transparent;
}

.nav__group {
  font-size: 12px;
  font-weight: 500;
  color: #9A918A;
  padding: 18px 12px 6px;
}
.nav__group:first-child { padding-top: 0; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav__item span { overflow: hidden; text-overflow: ellipsis; }
.nav__item:hover { background: var(--sidebar-hover); color: var(--blanco); }
.nav__item.is-active { background: var(--naranja); color: var(--carbon); font-weight: 700; }

.nav__badge {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--naranja);
  color: var(--carbon);
}

.sidebar__footer {
  border-top: 1px solid #333;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.local {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--blanco);
}
.local__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.local__text strong { font-weight: 700; }
.local__text span { font-size: 13px; color: #9A918A; }

/* Sidebar contraído (rail) */
.app.is-collapsed .sidebar { width: var(--sidebar-rail); }
.app.is-collapsed .logo-full { display: none; }
.app.is-collapsed .logo-icon { display: block; }
.app.is-collapsed .sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app.is-collapsed .nav__item { justify-content: center; padding: 0; position: relative; }
.app.is-collapsed .nav__item span,
.app.is-collapsed .local__text { display: none; }
.app.is-collapsed .nav__group { font-size: 0; padding: 10px 0 4px; border-top: 1px solid #333; margin: 8px 10px 0; }
.app.is-collapsed .nav__group:first-child { border-top: 0; margin-top: 0; }
.app.is-collapsed .nav__badge { position: absolute; top: 9px; right: 12px; min-width: 0; width: 10px; height: 10px; padding: 0; font-size: 0; border: 2px solid var(--carbon); }
.app.is-collapsed .local { justify-content: center; padding: 8px 0; }

/* =========================================================
   Topbar
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(245, 241, 238, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}

.icon-btn.topbar__menu { display: none; }

.topbar__title { min-width: 0; }
.topbar__title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.topbar__title p { font-size: 13px; color: var(--texto-suave); }

.search {
  flex: 1;
  max-width: 420px;
  margin-left: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 12px;
  color: var(--texto-suave);
}
.search:focus-within { border-color: var(--carbon); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--texto);
}
.search input::placeholder { color: #8C837C; }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  position: relative;
}
.icon-btn:hover { background: rgba(28, 28, 28, .06); }
.sidebar .icon-btn:hover { background: var(--sidebar-hover); }

.badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--naranja);
  color: var(--carbon);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  display: grid;
  place-items: center;
  border: 2px solid var(--hueso);
}

.user {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 4px 8px 4px 4px;
  border-radius: 14px;
  text-align: left;
}
.user:hover { background: rgba(28, 28, 28, .06); }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--carbon);
  color: var(--naranja);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.user__text { display: flex; flex-direction: column; line-height: 1.2; }
.user__text strong { font-size: 14px; }
.user__text span { font-size: 12px; color: var(--texto-suave); }

/* =========================================================
   Componentes
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--naranja); color: var(--carbon); }
.btn--primary:hover { background: #E57500; }
.btn--dark { background: var(--carbon); color: var(--blanco); }
.btn--dark:hover { background: #333; }
.btn--outline { border-color: var(--carbon); background: transparent; }
.btn--outline:hover { background: var(--carbon); color: var(--blanco); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; }

.link { font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link:hover { color: #B35C00; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--error { background: var(--error-bg); color: var(--error); }
.pill--neutral { background: var(--hueso); color: var(--texto-suave); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 0;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.card__head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.005em; }
.card__sub { font-size: 13px; color: var(--texto-suave); margin-top: 2px; }

/* =========================================================
   Hero: ventas de hoy
   ========================================================= */
.hero {
  background: var(--naranja);
  border-color: var(--naranja);
  color: var(--carbon);
  padding: 26px 28px 20px;
  display: flex;
  flex-direction: column;
}

.hero__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.hero__label { font-size: 16px; font-weight: 700; }
.hero__total {
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 6px 0 8px;
}
.hero__compare { font-size: 14px; font-weight: 500; }

.segmented {
  display: flex;
  background: rgba(28, 28, 28, .1);
  border-radius: 12px;
  padding: 3px;
}
.segmented button {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
}
.segmented button.is-active { background: var(--carbon); color: var(--blanco); }

.chart {
  height: 200px;
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-bottom: 2px solid var(--carbon);
  padding-top: 8px;
}
.chart__bar {
  flex: 1;
  max-width: 40px;
  margin: 0 auto;
  height: var(--h);
  min-height: 6px;
  background: var(--carbon);
  border-radius: 6px 6px 0 0;
  position: relative;
  transform-origin: bottom;
  animation: grow .6s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i) * 30ms);
}
.chart__bar.is-now { background: repeating-linear-gradient(135deg, var(--carbon) 0 5px, #3d3d3d 5px 10px); }
.chart__bar.is-future {
  background: transparent;
  border: 1.5px dashed rgba(28, 28, 28, .35);
  border-bottom: 0;
  height: 22px;
  animation: none;
}
.chart__bar.is-peak::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chart__axis {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 500;
}
.chart__axis span { flex: 1; text-align: center; max-width: 40px; margin: 0 auto; }

@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* =========================================================
   KPIs
   ========================================================= */
.kpis {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: var(--gap);
}
.kpi { padding: 20px 22px; }
.kpi__label { font-size: 14px; font-weight: 500; color: var(--texto-suave); }
.kpi__value { font-size: clamp(24px, 2.3vw, 32px); font-weight: 900; letter-spacing: -.025em; line-height: 1.15; margin-top: 4px; }
.kpi__hint { font-size: 13px; color: var(--texto-suave); margin-top: 4px; }
.kpi--caja { background: var(--carbon); border-color: var(--carbon); color: var(--blanco); }
.kpi--caja .kpi__label, .kpi--caja .kpi__hint { color: #B9B0A8; }
.kpi--caja .kpi__value { color: var(--naranja); }
.kpi--caja .btn { margin-top: 14px; background: var(--naranja); color: var(--carbon); }
.kpi--caja .btn:hover { background: #E57500; }

/* =========================================================
   Mesas
   ========================================================= */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--hueso);
  border-radius: 12px;
  padding: 3px;
}
.tabs button {
  border: 0;
  background: transparent;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--texto-suave);
}
.tabs button[aria-selected="true"] { background: var(--blanco); color: var(--texto); box-shadow: 0 1px 2px rgba(28, 28, 28, .12); }

.mesas__vacio { grid-column: 1 / -1; padding: 8px 0; }
.mesas__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.mesa {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 88px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--linea);
  background: var(--blanco);
  text-align: left;
  transition: transform .15s;
}
.mesa:hover { transform: translateY(-2px); }
.mesa__num { font-size: 20px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.mesa__meta { font-size: 13px; font-weight: 500; color: var(--texto-suave); }
.mesa__meta strong { color: inherit; font-weight: 700; }

.mesa--ocupada { background: var(--carbon); border-color: var(--carbon); color: var(--blanco); }
.mesa--ocupada .mesa__meta { color: #C9C1BA; }
.mesa--cobrar { background: var(--naranja); border-color: var(--naranja); color: var(--carbon); }
.mesa--cobrar .mesa__meta { color: var(--carbon); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--texto-suave);
}
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 4px; }
.sw--libre { border: 1.5px solid var(--linea); background: var(--blanco); }
.sw--ocupada { background: var(--carbon); }
.sw--cobrar { background: var(--naranja); }

/* =========================================================
   Facturación electrónica
   ========================================================= */
.fe__list { display: flex; flex-direction: column; gap: 12px; }

.fe__row {
  border: 1px solid var(--linea);
  border-radius: var(--radius);
  padding: 16px;
}
.fe__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.fe__name { font-weight: 700; }
.fe__provider { font-size: 13px; color: var(--texto-suave); }

.fe__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.fe__stat {
  background: var(--hueso);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.fe__stat b { display: block; font-size: 22px; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.fe__stat span { font-size: 12px; font-weight: 500; color: var(--texto-suave); }
.fe__stat.is-warn { background: var(--warn-bg); }
.fe__stat.is-warn b, .fe__stat.is-warn span { color: var(--warn); }
.fe__stat.is-error { background: var(--error-bg); }
.fe__stat.is-error b, .fe__stat.is-error span { color: var(--error); }

.fe__alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}
.fe__alert .link { margin-left: auto; color: var(--error); }

/* =========================================================
   Más vendidos
   ========================================================= */
.top__list { display: flex; flex-direction: column; gap: 14px; counter-reset: top; }
.top__item { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 4px 10px; }
.top__item::before {
  counter-increment: top;
  content: counter(top);
  grid-row: span 2;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--hueso);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.top__item:first-child::before { background: var(--naranja); }
.top__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__qty { font-weight: 700; font-size: 14px; }
.top__bar { grid-column: 2 / 4; height: 6px; background: var(--hueso); border-radius: 3px; overflow: hidden; }
.top__bar i { display: block; height: 100%; width: var(--w); background: var(--carbon); border-radius: 3px; }

/* =========================================================
   Stock bajo
   ========================================================= */
.stock { display: flex; flex-direction: column; }
.stock__list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; flex: 1; }
.stock__item { display: flex; flex-direction: column; gap: 6px; }
.stock__row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.stock__row strong { font-weight: 500; }
.stock__row span { color: var(--texto-suave); white-space: nowrap; }
.stock__row span b { color: var(--texto); }
.meter { height: 6px; border-radius: 3px; background: var(--hueso); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w); border-radius: 3px; background: var(--naranja); }
.meter.is-critical i { background: var(--error); }

/* =========================================================
   Métodos de pago
   ========================================================= */
.stackbar {
  display: flex;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  gap: 3px;
  margin-bottom: 18px;
}
.stackbar i { display: block; width: var(--w); background: var(--c); }

.pagos__list { display: flex; flex-direction: column; gap: 12px; }
.pagos__item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pagos__item .sw { flex-shrink: 0; }
.pagos__item .name { font-weight: 500; }
.pagos__item .pct { color: var(--texto-suave); margin-left: 4px; }
.pagos__item .amount { margin-left: auto; font-weight: 700; }

/* =========================================================
   Tabla de ventas
   ========================================================= */
.ventas { padding-bottom: 8px; }
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--texto-suave);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--linea);
  white-space: nowrap;
}
.table td { padding: 14px 12px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table .num { text-align: right; }
.table td.num { font-weight: 700; }
.table .id { font-weight: 700; }
.table tbody tr:hover td { background: #FBF9F7; }

/* =========================================================
   Páginas de módulo: encabezado, filtros, listados
   ========================================================= */
.content > .alert { margin-bottom: 18px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.subnav {
  display: flex;
  gap: 4px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 4px;
}
.subnav a {
  min-height: 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--texto-suave);
}
.subnav a:hover { color: var(--texto); background: var(--hueso); }
.subnav a.is-active { background: var(--carbon); color: var(--blanco); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 2px; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search--inline { display: flex; flex: 1 1 280px; max-width: none; margin: 0; }

.select { position: relative; display: block; }
.select select, .field select {
  appearance: none;
  height: 44px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231C1C1C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  cursor: pointer;
  width: 100%;
}
.select select:focus, .field select:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }

.card--flush { padding: 0; overflow: hidden; }
.card--flush .table-wrap { margin: 0; padding: 0 22px; }
.card--flush .table th { padding-top: 16px; }

.table .cell-actions { text-align: right; }
.cell-actions { display: flex; justify-content: flex-end; gap: 6px; }
.table td.cell-actions { display: table-cell; }
.table td.cell-actions > * { display: inline-flex; vertical-align: middle; }
.table td.cell-actions form { margin: 0 0 0 6px; }
.table tr.is-muted td:not(.cell-actions) { opacity: .55; }

.prod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prod__img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--hueso); }
.prod__img--vacia {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--carbon);
  background: color-mix(in srgb, var(--c) 28%, var(--blanco));
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--blanco));
}
.prod__name { display: block; font-weight: 700; white-space: normal; }
a.prod__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.prod__code { display: block; font-size: 13px; color: var(--texto-suave); }

.cat { display: inline-flex; align-items: center; gap: 8px; }
.cat i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cat--lg { font-weight: 700; }
.cat--lg i { width: 14px; height: 14px; border-radius: 4px; }

.muted { color: var(--texto-suave); }
.stock-bajo { color: var(--error); font-weight: 700; }

.btn--ghost { background: transparent; color: var(--texto); }
.btn--ghost:hover { background: rgba(28, 28, 28, .06); }
.btn--danger { background: var(--error); color: var(--blanco); }
.btn--danger:hover { background: #8F1C13; }
.btn svg { width: 18px; height: 18px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--linea);
  font-size: 14px;
  color: var(--texto-suave);
}
.pager__nav { display: flex; align-items: center; gap: 12px; }

.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Indicadores del módulo */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); margin-bottom: 18px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radius-lg);
}
.stat__label { font-size: 14px; font-weight: 500; color: var(--texto-suave); }
.stat__value { font-size: 28px; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.stat__hint { font-size: 13px; color: var(--texto-suave); }
.stat--link:hover { border-color: var(--carbon); }
.stat--warn { background: var(--warn-bg); border-color: #F6D2A6; }
.stat--warn .stat__value, .stat--warn .stat__label { color: var(--warn); }
.stat--error { background: var(--error-bg); border-color: #F3C9C4; }
.stat--error .stat__value, .stat--error .stat__label { color: var(--error); }

/* Stock con estado */
.stock { font-weight: 700; white-space: nowrap; }
.stock--bajo { color: var(--warn); }
.stock--negativo { color: var(--error); }

/* Cantidades en el kárdex */
.qty { font-weight: 700; white-space: nowrap; }
.qty--mas { color: var(--ok); }
.qty--menos { color: var(--error); }

/* =========================================================
   Formularios
   ========================================================= */
.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field label, .field legend, .field__label { font-size: 14px; font-weight: 700; padding: 0; }
.field .opt { font-weight: 500; color: var(--texto-suave); margin-left: 4px; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field textarea {
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  background: var(--blanco);
  font: inherit;
  font-size: 16px;
  color: var(--texto);
  width: 100%;
  transition: border-color .15s;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: #CFC6BE; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }
.field [aria-invalid="true"] { border-color: var(--error) !important; }
.field__error { font-size: 13px; font-weight: 500; color: var(--error); }
.field__hint { font-size: 13px; color: var(--texto-suave); }
.field__static { height: 48px; display: flex; align-items: center; font-weight: 700; font-size: 16px; }
.field--end { justify-content: flex-end; padding-bottom: 8px; }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.input-money { position: relative; }
.input-money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--texto-suave); pointer-events: none; }
.field .input-money input { padding-left: 30px !important; font-weight: 700; }

/* Opciones tipo botón (radio) */
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  background: var(--blanco);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.choice__opt span:hover { border-color: #CFC6BE; }
.choice__opt input:checked + span { background: var(--carbon); border-color: var(--carbon); color: var(--blanco); }
.choice__opt input:focus-visible + span { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 44px; height: 26px; border-radius: 13px; background: #D6CEC7; position: relative; transition: background .15s; flex-shrink: 0; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--blanco); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--naranja); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--carbon); outline-offset: 2px; }
.switch input:disabled ~ * { opacity: .5; cursor: not-allowed; }

/* Casilla */
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--carbon); margin: 0; }

/* Layout del formulario */
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--gap);
  align-items: start;
}
.form-main, .form-aside { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.form-aside { position: sticky; top: 96px; }
.form-section { display: flex; flex-direction: column; gap: 18px; }
.form-section h2 { font-size: 17px; font-weight: 700; }
.form-section__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-section [hidden] { display: none !important; }

.form-actions {
  grid-column: 1 / -1;
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--hueso) 75%, rgba(245, 241, 238, 0));
}

/* Resumen de precio */
.calc {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--linea);
  border: 1px solid var(--linea);
  border-radius: 14px;
  overflow: hidden;
}
.calc > div { background: var(--hueso); padding: 12px 14px; }
.calc dt { font-size: 12px; font-weight: 500; color: var(--texto-suave); }
.calc dd { margin: 2px 0 0; font-size: 18px; font-weight: 900; letter-spacing: -.01em; }
.calc dd.is-negative { color: var(--error); }

/* Subida de imagen */
.upload {
  position: relative;
  aspect-ratio: 1;
  border: 2px dashed var(--linea);
  border-radius: 16px;
  background: var(--hueso);
  overflow: hidden;
}
.upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.upload.has-image img { display: block; }
.upload.is-removing img { opacity: .25; }
.upload__drop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--texto-suave);
}
.upload__drop strong { font-size: 15px; color: var(--texto); text-decoration: underline; text-underline-offset: 3px; }
.upload.has-image .upload__drop { inset: auto 10px 10px 10px; background: rgba(28, 28, 28, .82); border-radius: 10px; padding: 10px; }
.upload.has-image .upload__drop strong { color: var(--blanco); }
.upload.has-image .upload__drop span { display: none; }
.upload:focus-within { border-color: var(--carbon); }

/* Campo con unidad al final */
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 500; color: var(--texto-suave); pointer-events: none; }
.input-suffix input { padding-right: 64px !important; }
.field--inline { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.field--inline .input-suffix { width: 180px; }

/* Receta */
.receta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.receta > div, .receta #recetaFilas { width: 100%; }
#recetaFilas { display: flex; flex-direction: column; gap: 8px; }
#recetaFilas:empty { display: none; }
.receta__head, .receta__fila { display: grid; grid-template-columns: minmax(0, 1fr) 180px 44px; gap: 8px; align-items: center; }
.receta__head { font-size: 13px; font-weight: 700; color: var(--texto-suave); }
.receta__head:has(+ #recetaFilas:empty) { display: none; }
.receta__fila input {
  height: 44px; width: 100%; padding: 0 14px; border: 1.5px solid var(--linea); border-radius: 12px;
  background: var(--blanco); font: inherit; font-size: 16px; color: var(--texto);
}
.receta__fila input:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }
.receta__fila [data-quitar-fila] { color: var(--texto-suave); }
.receta__fila [data-quitar-fila]:hover { color: var(--error); background: var(--error-bg); }

/* Formulario angosto (una columna) */
.form-narrow { max-width: 720px; display: flex; flex-direction: column; gap: var(--gap); }
.form-narrow .form-actions { grid-column: auto; }

/* Opciones grandes con descripción */
.choice--cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice--cards .choice__opt span { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 76px; padding: 12px 14px; height: 100%; }
.choice--cards .choice__opt strong { font-size: 15px; }
.choice--cards .choice__opt small { font-size: 13px; font-weight: 500; color: var(--texto-suave); line-height: 1.3; }
.choice--cards .choice__opt input:checked + span small { color: #D9D2CC; }

/* Filtros de fecha compactos */
.field--compact { flex-direction: row; align-items: center; gap: 8px; }
.field--compact span { font-size: 14px; font-weight: 700; }
.field--compact input {
  height: 44px; padding: 0 12px; border: 1px solid var(--linea); border-radius: 12px;
  background: var(--blanco); font: inherit; font-size: 15px; color: var(--texto);
}

/* Cabecera del kárdex */
.kardex-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; margin-bottom: 18px; }
.kardex-head h2 { font-size: 22px; font-weight: 900; letter-spacing: -.015em; }
.kardex-head__datos { display: flex; gap: 28px; margin: 0; flex-wrap: wrap; }
.kardex-head__datos dt { font-size: 13px; color: var(--texto-suave); }
.kardex-head__datos dd { margin: 2px 0 0; font-size: 18px; font-weight: 900; }
.kardex-head__acciones { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

/* Producción */
.prod-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; margin-bottom: var(--gap); }
.consumo { background: var(--hueso); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.consumo h3 { font-size: 14px; font-weight: 700; }
.table--compact { min-width: 0; }
.table--compact th { padding: 0 8px 8px 0; }
.table--compact td { padding: 8px 8px 8px 0; white-space: normal; }
.consumo .table td, .consumo .table th { border-color: var(--linea); }
.hoy-list { display: flex; flex-direction: column; }
.hoy-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.hoy-list li:last-child { border-bottom: 0; }
.card__title { font-size: 17px; font-weight: 700; padding: 20px 22px 4px; }

/* Zona de peligro */
.danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  border-color: #F3C9C4;
}
.danger h2 { font-size: 16px; font-weight: 700; color: var(--error); }
.danger p { font-size: 14px; color: var(--texto-suave); margin-top: 2px; max-width: 60ch; }

/* Alertas */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.alert--error { background: var(--error-bg); color: var(--error); }
.alert--ok    { background: var(--ok-bg); color: var(--ok); }
.alert--info  { background: var(--blanco); border: 1px solid var(--linea); color: var(--texto); }

/* =========================================================
   Modal (dialog)
   ========================================================= */
.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--blanco);
  color: var(--texto);
  box-shadow: 0 24px 60px rgba(28, 28, 28, .28);
}
.modal::backdrop { background: rgba(28, 28, 28, .55); }
.modal__box { display: flex; flex-direction: column; gap: 20px; padding: 22px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -8px 0 0; }
.modal__head h2 { font-size: 20px; font-weight: 900; letter-spacing: -.015em; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch > span { display: block; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; border: 3px solid var(--blanco); box-shadow: 0 0 0 1px var(--linea); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--carbon); }
.swatch input:focus-visible + span { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* =========================================================
   Compras
   ========================================================= */
.date { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 12px; font-size: 14px; color: var(--texto-suave); }
.date input { border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--texto); height: 40px; }
.date input:focus { outline: none; }
.date:focus-within { border-color: var(--carbon); }
.pager__sum { margin-left: 12px; color: var(--texto); }

.field__with-action { display: flex; gap: 8px; }
.field__with-action select { flex: 1; min-width: 0; }
.field__with-action .btn { flex-shrink: 0; }

/* Líneas de productos: cada una es una tarjeta con el producto arriba */
.lineas { display: flex; flex-direction: column; gap: 10px; }
.linea {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) 90px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--linea);
  border-radius: 14px;
  background: var(--blanco);
}
.linea:focus-within { border-color: #CFC6BE; }
.linea .field { gap: 4px; }
.linea__prod { grid-column: 1 / -1; padding-right: 44px; }
.linea__label { font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.linea__hint { font-size: 12px; color: var(--texto-suave); min-height: 16px; }
.linea__total { display: flex; flex-direction: column; gap: 4px; text-align: right; }
.linea__total strong { height: 48px; display: flex; align-items: center; justify-content: flex-end; font-size: 17px; }
.linea__quitar { position: absolute; top: 8px; right: 8px; }
.linea .field select { height: 48px; }
.linea .input-suffix input { padding-right: 52px !important; }

/* Resumen lateral */
.resumen__lista { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.resumen__lista div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.resumen__lista dt { color: var(--texto-suave); }
.resumen__lista dd { margin: 0; font-weight: 700; }
.resumen__total { border-top: 1px solid var(--linea); padding-top: 12px; }
.resumen__total dt { color: var(--texto) !important; font-weight: 700; }
.resumen__total dd { font-size: 26px; font-weight: 900 !important; letter-spacing: -.02em; }

/* Documento (detalle de compra) */
.doc { display: flex; flex-direction: column; gap: var(--gap); }
.doc__head { display: grid; grid-template-columns: 1fr auto; gap: 16px 20px; }
.doc__num { font-size: 13px; font-weight: 700; color: var(--texto-suave); letter-spacing: .02em; }
.doc__title { font-size: 24px; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.doc__datos { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; padding-top: 16px; border-top: 1px solid var(--linea); }
.doc__datos dt { font-size: 12px; color: var(--texto-suave); }
.doc__datos dd { margin: 2px 0 0; font-weight: 500; }
.doc__aviso { grid-column: 1 / -1; }
.doc__totales { margin: 0; padding: 16px 22px 20px; border-top: 1px solid var(--linea); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.doc__totales div { display: flex; gap: 24px; min-width: 240px; justify-content: space-between; }
.doc__totales dt { color: var(--texto-suave); }
.doc__totales dd { margin: 0; font-weight: 700; }
.doc__total dt { color: var(--texto) !important; font-weight: 700; }
.doc__total dd { font-size: 22px; font-weight: 900 !important; }
.card__title--flush { padding: 0 0 8px; }
.lista-simple { margin: 8px 0 0; padding-left: 18px; list-style: disc; }
.lista-simple li { margin-top: 2px; }

.modal--wide { width: min(640px, calc(100vw - 24px)); }
.modal__izq { margin-right: auto; color: var(--error); }

/* =========================================================
   Caja
   ========================================================= */
a.pill:hover { filter: brightness(.96); }

.caja-cerrada { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; max-width: 980px; }
.caja-abrir__titulo { font-size: 26px; font-weight: 900; letter-spacing: -.02em; margin: 6px 0 4px; }
.caja-estado { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ok); }
.caja-estado--cerrada { color: var(--texto-suave); }
.caja-info { margin-bottom: 16px; font-size: 15px; }
.caja-info .caja-estado { margin-right: 4px; }

.input-money--lg input { height: 60px !important; font-size: 24px !important; font-weight: 900 !important; }
.input-money--lg span { font-size: 20px; }

.caja-efectivo { grid-column: span 5; background: var(--carbon); border-color: var(--carbon); color: var(--blanco); }
.caja-efectivo .kpi__label { color: #B9B0A8; }
.caja-efectivo__valor { font-size: clamp(34px, 4vw, 48px); font-weight: 900; letter-spacing: -.03em; color: var(--naranja); margin: 4px 0 16px; line-height: 1.1; }
.caja-cuenta { margin: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid #333; }
.caja-cuenta div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.caja-cuenta dt { color: #B9B0A8; }
.caja-cuenta dd { margin: 0; font-weight: 700; }

.caja-ventas { grid-column: span 7; }
.caja-ventas__total { font-size: 32px; font-weight: 900; letter-spacing: -.025em; margin: -6px 0 14px; }
.caja-movs, .caja-arqueos { grid-column: span 6; display: flex; flex-direction: column; gap: 12px; }
.caja-movs .card__head, .caja-arqueos .card__head { margin-bottom: 0; }

.movs { display: flex; flex-direction: column; }
.movs__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); }
.movs__item:last-child { border-bottom: 0; }
.movs__item div { display: flex; flex-direction: column; min-width: 0; }
.movs__item .muted { font-size: 13px; }

.dif--ok { color: var(--ok); font-weight: 700; }
.dif--mal { color: var(--error); font-weight: 700; }

/* Conteo de billetes y monedas */
.conteo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.conteo__grupo { display: flex; flex-direction: column; gap: 8px; }
.conteo__grupo h3 { font-size: 13px; font-weight: 700; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .04em; }
.conteo__fila {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
}
.conteo__fila.has-valor { background: var(--hueso); }
.conteo__denom { font-weight: 700; font-size: 15px; }
.conteo__sub { text-align: right; font-weight: 700; font-size: 14px; color: var(--texto-suave); }
.conteo__fila.has-valor .conteo__sub { color: var(--texto); }
.conteo__fila--otro { grid-template-columns: 84px minmax(0, 1fr) 96px; }
.conteo .input-money input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 28px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  background: var(--blanco);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--texto);
}
.conteo .input-money input:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }

.stepper { display: flex; align-items: center; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--blanco); overflow: hidden; }
.stepper:focus-within { border-color: var(--carbon); }
.stepper__btn { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.stepper__btn:hover { background: var(--hueso); }
.stepper input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  text-align: center;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

.arqueo-dif { padding: 12px 14px; border-radius: 12px; background: var(--hueso); font-weight: 700; text-align: center; color: var(--texto-suave); }
.arqueo-dif--ok { background: var(--ok-bg); color: var(--ok); }
.arqueo-dif--mal { background: var(--error-bg); color: var(--error); }
.arqueo-detalle summary { cursor: pointer; font-size: 14px; font-weight: 700; min-height: 32px; }
.arqueo-detalle .resumen__lista { margin-top: 8px; font-size: 14px; }

/* =========================================================
   Punto de venta
   ========================================================= */
.pagina-pos .content { max-width: none; padding: 16px 20px; }
.pos-cerrada { margin-top: 40px; }

.pos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  height: calc(100dvh - 105px);
  min-height: 520px;
}

.pos__catalogo { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.pos__barra { display: flex; gap: 10px; }
.pos__buscar { flex: 1; }
.pos__buscar input { font-size: 16px; }

.pos__cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; flex-shrink: 0; }
.pos-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--linea);
  border-radius: 22px;
  background: var(--blanco);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.pos-cat i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--carbon)); }
.pos-cat:hover { border-color: #CFC6BE; }
.pos-cat.is-active { background: var(--carbon); border-color: var(--carbon); color: var(--blanco); }

.pos__grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 2px 2px 16px;
}
.pos-prod {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 8px 12px;
  border: 1.5px solid var(--linea);
  border-radius: 16px;
  background: var(--blanco);
  text-align: left;
  transition: transform .08s, border-color .15s;
}
.pos-prod:hover { border-color: var(--carbon); }
.pos-prod:active { transform: scale(.97); }
.pos-prod__media { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; margin-bottom: 4px; }
.pos-prod__media img { width: 100%; height: 100%; object-fit: cover; }
.pos-prod__ini {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--carbon);
  background: color-mix(in srgb, var(--c) 30%, var(--blanco));
}
.pos-prod__nombre { font-weight: 700; font-size: 15px; line-height: 1.25; padding: 0 4px; }
.pos-prod__precio { font-weight: 900; font-size: 16px; padding: 0 4px; }
.pos-prod__stock { font-size: 12px; color: var(--texto-suave); padding: 0 4px; }
.pos-prod.is-sin-stock .pos-prod__stock { color: var(--warn); font-weight: 700; }
.pos-sin-resultados { grid-column: 1 / -1; text-align: center; color: var(--texto-suave); padding: 40px 0; }

/* Cuenta */
.pos__cuenta {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 20px;
  overflow: hidden;
}
.pos-cuenta__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; }
.pos-cuenta__head h2 { font-size: 18px; font-weight: 900; margin-right: auto; }
.icon-btn.pos-cuenta__cerrar { display: none; }

.pos-cliente {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--linea);
  border-radius: 14px;
  background: var(--hueso);
  text-align: left;
}
.pos-cliente:hover { border-color: #CFC6BE; }
.pos-cliente span:not(.pos-cliente__fe) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pos-cliente small { font-size: 12px; color: var(--texto-suave); }
.pos-cliente strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-cliente__fe { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }

.pos-items { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px; }
.pos-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "info total" "info cant";
  gap: 6px 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--linea);
}
.pos-item.is-nuevo { animation: nuevo .6s ease; }
@keyframes nuevo { from { background: var(--naranja-suave); } to { background: transparent; } }
.pos-item__info { grid-area: info; display: flex; flex-direction: column; gap: 2px; border: 0; background: none; padding: 0; text-align: left; min-width: 0; }
.pos-item__nombre { font-weight: 700; }
.pos-item__meta { font-size: 13px; color: var(--texto-suave); }
.pos-item__desc { color: var(--ok); font-weight: 700; margin-left: 4px; }
.pos-item__nota { font-size: 13px; font-style: italic; color: var(--texto-suave); }
.pos-item__aviso { font-size: 12px; font-weight: 700; color: var(--warn); }
.pos-item__total { grid-area: total; text-align: right; font-size: 16px; }
.pos-item__cant { grid-area: cant; display: flex; align-items: center; border: 1.5px solid var(--linea); border-radius: 12px; overflow: hidden; }
.pos-item__btn { width: 40px; height: 40px; border: 0; background: var(--blanco); font-size: 20px; font-weight: 700; }
.pos-item__btn:hover { background: var(--hueso); }
.pos-item__num { min-width: 44px; height: 40px; border: 0; background: var(--blanco); font-weight: 900; font-size: 15px; padding: 0 6px; }

.pos-vacia { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 32px; gap: 4px; }
.pos-vacia[hidden] { display: none; }

.pos-cuenta__pie { padding: 12px 16px 16px; border-top: 1px solid var(--linea); display: flex; flex-direction: column; gap: 8px; background: var(--blanco); }
.pos-totales { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.pos-totales div { display: flex; justify-content: space-between; font-size: 14px; }
.pos-totales dt { color: var(--texto-suave); }
.pos-totales dd { margin: 0; font-weight: 700; }
.pos-desc-btn { align-self: flex-start; background: none; border: 0; padding: 4px 0; }
.pos-cobrar { min-height: 64px; justify-content: space-between; padding: 0 20px; font-size: 18px; }
.pos-cobrar strong { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.pos-cobrar:disabled { opacity: .45; cursor: not-allowed; }

.pos-vercuenta { display: none; }
.search.pos__buscar { display: flex; }   /* el buscador del POS se ve en todos los tamaños */
.pago select {
  appearance: none;
  height: 48px;
  padding: 0 40px 0 14px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  background: var(--blanco) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%231C1C1C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  font: inherit;
  font-weight: 700;
  color: var(--texto);
}
.pago select:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }

/* Controles compartidos de los diálogos del POS */
.segmented--claro { background: var(--hueso); }
.segmented--claro button { min-width: 44px; }
.desc-input { display: flex; gap: 8px; align-items: stretch; }
.desc-input input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--linea); border-radius: 12px; font: inherit; font-size: 18px; font-weight: 700; }
.desc-input input:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }
.desc-input--lg input { height: 60px; font-size: 24px; }
.pos-linea-total { text-align: right; font-size: 15px; }
.pos-linea-total strong { font-size: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--linea);
  border-radius: 20px;
  background: var(--blanco);
  font-weight: 700;
  font-size: 14px;
}
.chip:hover { border-color: var(--carbon); }

.cli-lista { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; max-height: 300px; overflow-y: auto; }
.cli-item { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--blanco); text-align: left; }
.cli-item:hover { border-color: var(--carbon); }
.cli-item .muted { font-size: 13px; }
.cli-vacio { color: var(--texto-suave); font-size: 14px; padding: 8px 2px; }
.cli-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cobro */
.modal--cobro { width: min(620px, calc(100vw - 24px)); }
.cobro-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px; border-radius: 16px; background: var(--carbon); color: var(--blanco); }
.cobro-total span { color: #B9B0A8; font-weight: 500; }
.cobro-total strong { font-size: 34px; font-weight: 900; letter-spacing: -.03em; color: var(--naranja); }
.cobro-pagos { display: flex; flex-direction: column; gap: 10px; }
.pago { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1.5px solid var(--linea); border-radius: 14px; }
.pago__fila { display: flex; gap: 8px; align-items: center; }
.pago__fila select { flex: 1; min-width: 0; height: 48px; border: 1.5px solid var(--linea); border-radius: 12px; padding: 0 12px; font: inherit; font-weight: 700; background: var(--blanco); }
.pago .input-money { flex: 1; }
.pago .input-money input, .pago__ref {
  width: 100%;
  height: 48px;
  padding: 0 12px 0 28px;
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  background: var(--blanco);
}
.pago__ref { padding-left: 12px; font-size: 15px; font-weight: 500; }
.pago input[readonly] { background: var(--hueso); }
.pago input:focus, .pago select:focus { outline: none; border-color: var(--carbon); box-shadow: 0 0 0 3px rgba(247, 127, 0, .35); }
.pago__efectivo { display: flex; flex-direction: column; gap: 8px; }
.pago__efectivo label { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.pago__efectivo label .input-money { flex: 1; }
.chips--billetes .chip { min-height: 44px; }
.cobro-estado { padding: 12px 14px; border-radius: 12px; font-weight: 700; text-align: center; background: var(--hueso); }
.cobro-estado.is-ok { background: var(--ok-bg); color: var(--ok); }
.cobro-estado.is-ok strong { font-size: 20px; }
.cobro-estado.is-error { background: var(--error-bg); color: var(--error); }

/* Venta lista */
.listo { text-align: center; align-items: center; }
.listo__ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); font-size: 32px; font-weight: 900; }
.listo h2 { font-size: 24px; font-weight: 900; }
.listo__cambio { width: 100%; padding: 16px; border-radius: 16px; background: var(--carbon); color: var(--blanco); display: flex; flex-direction: column; gap: 4px; }
.listo__cambio[hidden] { display: none; }
.listo__cambio span { color: #B9B0A8; }
.listo__cambio strong { font-size: 40px; font-weight: 900; color: var(--naranja); letter-spacing: -.03em; }
.listo__avisos { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.listo__avisos li { padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 500; }
.listo__acciones { width: 100%; }
.listo__acciones .btn { flex: 1; }

.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

.pos-aviso {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--carbon);
  color: var(--blanco);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
}
.pos-aviso.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   Mesas: plano, lista y editor
   ========================================================= */
.segmented button[aria-pressed="true"] { background: var(--carbon); color: var(--blanco); }
.subnav--scroll { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.subnav--scroll a { white-space: nowrap; }
.subnav--bloque { margin-bottom: 16px; width: fit-content; }

.mesas-resumen { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; font-size: 14px; color: var(--texto-suave); }
.mesas-resumen li { display: flex; align-items: center; gap: 8px; }
.mesas-resumen strong { color: var(--texto); font-size: 16px; }

.plano-wrap { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radius-lg); padding: 16px; overflow-x: auto; }
.plano {
  position: relative;
  width: 100%;
  min-width: 560px;
  border-radius: 14px;
  background-color: #FBF9F7;
  background-image: radial-gradient(circle, #DDD4CC 1px, transparent 1.2px);
  background-size: 24px 24px;
}
.plano--editor { background-size: 20px 20px; touch-action: none; }

.pmesa {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px;
  border: 2px solid var(--linea);
  border-radius: 14px;
  background: var(--blanco);
  color: var(--texto);
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  container-type: size;
  transition: box-shadow .15s, transform .15s;
  font: inherit;
}
.pmesa--redonda { border-radius: 50%; }
.pmesa:hover { box-shadow: 0 6px 18px rgba(28, 28, 28, .14); z-index: 2; }
.pmesa .m-nombre { font-size: clamp(14px, 28cqmin, 26px); font-weight: 900; letter-spacing: -.02em; }
.pmesa .m-meta { font-size: clamp(10px, 12cqmin, 13px); color: var(--texto-suave); }
.pmesa .m-total { font-size: clamp(10px, 13cqmin, 14px); font-weight: 700; }
.pmesa .m-listo, .mesa .m-listo {
  position: absolute;
  top: 6%;
  right: 6%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--blanco);
  font-size: 0;
}
.pmesa.is-ocupada { background: var(--carbon); border-color: var(--carbon); color: var(--blanco); }
.pmesa.is-ocupada .m-meta { color: #C9C1BA; }
.pmesa.is-por_cobrar { background: var(--naranja); border-color: var(--naranja); color: var(--carbon); }
.pmesa.is-por_cobrar .m-meta { color: var(--carbon); }

.pmesa.is-editable { cursor: grab; touch-action: none; user-select: none; }
.pmesa.is-arrastrando { cursor: grabbing; box-shadow: 0 12px 28px rgba(28, 28, 28, .25); transform: scale(1.04); z-index: 5; transition: none; }
.pmesa.is-seleccionada { border-color: var(--naranja); box-shadow: 0 0 0 4px rgba(247, 127, 0, .3); z-index: 3; }

.mesa { position: relative; text-decoration: none; }
.mesa .m-nombre { font-size: 20px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.mesa .m-meta { font-size: 13px; font-weight: 500; color: var(--texto-suave); }
.mesa .m-total { font-size: 13px; font-weight: 700; }
.mesa--ocupada .m-meta { color: #C9C1BA; }
.mesa--cobrar .m-meta { color: var(--carbon); }
.mesa .m-listo { top: 10px; right: 10px; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.editor__lienzo { display: flex; flex-direction: column; gap: 12px; overflow-x: auto; }
.editor__barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor__panel { display: flex; flex-direction: column; gap: var(--gap); position: sticky; top: 96px; }
.editor__acciones { grid-column: 1 / -1; align-items: center; }
.editor__estado { margin-right: auto; font-size: 14px; color: var(--texto-suave); }
.editor__estado.is-sucio { color: var(--warn); font-weight: 700; }
.forma { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.forma--redonda { border-radius: 50%; }
.forma--rectangular { width: 20px; height: 12px; }
.chip--mesa { min-width: 64px; min-height: 48px; justify-content: center; font-size: 16px; font-weight: 900; }
.mover-lista { display: flex; flex-wrap: wrap; gap: 8px; max-height: 50vh; overflow-y: auto; }

/* =========================================================
   Pedido de mesa
   ========================================================= */
.ped-titulo { flex: 1; min-width: 0; }
.ped-titulo h2 { font-size: 20px; }
.ped-titulo p { font-size: 13px; }
.ped-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 0; padding: 0 16px; }
.ped-scroll .pos-items { padding: 0; overflow: visible; }
.ped-seccion { padding: 10px 0; border-bottom: 1px solid var(--linea); }
.ped-seccion h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--texto-suave); margin-bottom: 6px; }
.ped-seccion h3 .pill { height: 26px; font-size: 12px; }
.ped-lista { display: flex; flex-direction: column; }
.ped-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 36px; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.ped-item__cant { font-weight: 900; font-size: 16px; text-align: center; background: var(--hueso); border-radius: 8px; padding: 4px 0; }
.ped-item__nombre { font-weight: 500; }
.ped-item__nombre small { display: block; font-size: 12px; color: var(--warn); font-weight: 700; }
.icon-btn--sm { width: 36px; height: 36px; }
.icon-btn--sm svg { width: 16px; height: 16px; }
.ped-agregar-nota { text-decoration: underline; text-underline-offset: 2px; }
.ped-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ped-acciones .btn { min-height: 52px; }
.ped-cancelar { align-self: center; color: var(--texto-suave); font-size: 13px; margin-top: 6px; background: none; border: 0; }
.pos-mesa-aviso { font-size: 13px; background: var(--naranja-suave); color: var(--warn); padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; }
.pos-mesa-aviso .link { color: inherit; }
.pos-item__cant--fija { justify-content: center; }
.pos-item__cant--fija .pos-item__num { cursor: default; }
.pos-item__info:disabled { cursor: default; opacity: 1; color: inherit; }

/* =========================================================
   Pantalla de cocina
   ========================================================= */
.kds-opciones { align-items: center; gap: 16px; }
.kds-estado { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.kds-estado.is-error { color: var(--error); }
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.kds-card {
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-top: 8px solid var(--naranja);
  border-radius: 16px;
  overflow: hidden;
}
.kds-card.is-en_preparacion { border-top-color: var(--carbon); }
.kds-card.is-lista { border-top-color: var(--ok); opacity: .75; }
.kds-card__head { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px 4px; }
.kds-card__mesa { font-size: 24px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.kds-card__meta { font-size: 13px; color: var(--texto-suave); }
.kds-card__tiempo { font-size: 18px; font-weight: 900; white-space: nowrap; padding: 4px 10px; border-radius: 10px; background: var(--hueso); height: fit-content; }
.kds-card.is-atento .kds-card__tiempo { background: var(--warn-bg); color: var(--warn); }
.kds-card.is-tarde .kds-card__tiempo { background: var(--error); color: var(--blanco); }
.kds-card__estado { padding: 0 16px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); }
.kds-card__items { padding: 8px 16px; border-top: 1px dashed var(--linea); display: flex; flex-direction: column; gap: 8px; }
.kds-card__items li { display: grid; grid-template-columns: 40px 1fr; gap: 8px; font-size: 18px; font-weight: 700; line-height: 1.25; }
.kds-card__items li.is-anulado { text-decoration: line-through; color: var(--texto-suave); }
.kds-cant { font-size: 22px; font-weight: 900; text-align: center; background: var(--hueso); border-radius: 8px; height: fit-content; }
.kds-nota { display: block; margin-top: 2px; font-size: 14px; font-weight: 900; color: var(--warn); text-transform: uppercase; }
.kds-card__pie { display: flex; gap: 8px; padding: 12px 16px 16px; }
.kds-card__pie .btn { min-height: 52px; font-size: 17px; }
.kds-vacio { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--texto-suave); }
.kds-vacio strong { font-size: 22px; color: var(--texto); }

/* =========================================================
   Configuración
   ========================================================= */
.page-head__texto { max-width: 70ch; font-size: 14px; }
.field--corto { max-width: 220px; }
.form__subtitulo { font-size: 14px; font-weight: 700; padding-top: 6px; border-top: 1px solid var(--linea); margin-top: 4px; padding-top: 14px; }
.filtro-activo { text-decoration: none; height: 44px; }

.config-links { display: flex; flex-direction: column; }
.config-links li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--linea); }
.config-links li:last-child { border-bottom: 0; }
.config-links a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.config-links span { font-size: 13px; color: var(--texto-suave); }

.empresas { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gap); }
.empresa { display: flex; flex-direction: column; gap: 16px; }
.empresa.is-muted { opacity: .6; }
.empresa__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.empresa__head h2 { font-size: 20px; font-weight: 900; letter-spacing: -.015em; }
.empresa__head p { font-size: 13px; }
.empresa__datos { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding-top: 14px; border-top: 1px solid var(--linea); }
.empresa__datos dt { font-size: 12px; color: var(--texto-suave); }
.empresa__datos dd { margin: 2px 0 0; font-weight: 500; font-size: 14px; word-break: break-word; }

/* =========================================================
   Usuarios, roles, mi cuenta y verificación en dos pasos
   ========================================================= */
a.user { text-decoration: none; color: inherit; }
.avatar--sm { width: 36px; height: 36px; font-size: 13px; flex-shrink: 0; }
.avatar--lg { width: 56px; height: 56px; font-size: 20px; flex-shrink: 0; }
.toolbar--flat { margin: 0; flex: 1; }
.etiquetas { display: flex; flex-wrap: wrap; gap: 4px; }
.etiqueta { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--hueso); font-size: 12px; font-weight: 700; color: var(--texto-suave); white-space: nowrap; }
.etiqueta--ok { background: var(--ok-bg); color: var(--ok); }
.etiqueta--warn { background: var(--warn-bg); color: var(--warn); }

.temporal { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: var(--gap); border: 2px solid var(--naranja); }
.temporal h2 { font-size: 17px; }
.temporal__clave { display: flex; align-items: center; gap: 10px; }
.temporal__clave code, .dosf__clave code, .codigos code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-weight: 700; }
.temporal__clave code { font-size: 22px; padding: 6px 12px; background: var(--hueso); border-radius: 10px; letter-spacing: .04em; }

.seguridad { margin-top: 8px; display: flex; flex-direction: column; gap: 12px; }
.seguridad h2 { font-size: 17px; }
.seguridad__acciones { display: flex; flex-wrap: wrap; gap: 8px; }

.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.rol-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.rol-card:hover { border-color: var(--carbon); box-shadow: 0 4px 14px rgba(28, 28, 28, .08); }
.rol-card__nombre { font-size: 19px; font-weight: 900; letter-spacing: -.015em; }

.permisos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.permisos__grupo { margin: 0; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 14px; display: flex; flex-direction: column; }
.permisos__grupo legend { padding: 0 4px; margin-left: -4px; }
.permisos__grupo legend .check span { font-weight: 900; font-size: 15px; }
.permisos__item { min-height: 36px; font-size: 14px; }
.permisos__item input:disabled + span, .permisos__grupo input:disabled + span { color: var(--texto-suave); }
.permisos-atajos { display: flex; gap: 14px; }

.dosf { max-width: 760px; }
.dosf__ok { width: fit-content; }
.pasos { display: flex; flex-direction: column; gap: 22px; padding-left: 20px; margin: 0; list-style: decimal; }
.pasos li { padding-left: 6px; line-height: 1.5; }
.pasos li::marker { font-weight: 900; color: var(--naranja); }
.dosf__qr { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 12px; }
#qr { width: 200px; height: 200px; padding: 8px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 14px; }
#qr svg { width: 100%; height: 100%; display: block; }
.dosf__clave { margin: 6px 0 10px; }
.dosf__clave code { font-size: 17px; letter-spacing: .06em; word-break: break-all; }
.dosf__form { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.dosf__form .field { width: 200px; }
.input-codigo-app { letter-spacing: .3em; font-size: 22px !important; font-weight: 900; text-align: center; }
.input-pin-chico { letter-spacing: .4em; font-weight: 900; }
.dosf__acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.codigos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 6px 0 4px; padding-left: 24px; }
.codigos code { font-size: 17px; letter-spacing: .05em; }

.cuenta { display: flex; flex-direction: column; gap: var(--gap); max-width: 820px; }
.cuenta__yo { display: flex; align-items: center; gap: 16px; }
.cuenta__yo h2 { font-size: 22px; font-weight: 900; }
.field-row--fin { align-items: end; }
.cuenta__botones { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 2px; }

.accion-alerta { color: var(--error); font-weight: 700; }
.actividad__detalle { white-space: normal !important; font-size: 13px; color: var(--texto-suave); max-width: 520px; }
.actividad__detalle details { margin-top: 4px; }
.actividad__detalle summary { cursor: pointer; font-weight: 700; color: var(--texto); }
.actividad__detalle pre { margin: 6px 0 0; padding: 10px; background: var(--hueso); border-radius: 10px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

@media print {
  .sidebar, .topbar, .dosf__acciones, .subnav { display: none !important; }
}

/* =========================================================
   Importar y exportar
   ========================================================= */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__lista {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 14px; box-shadow: 0 12px 30px rgba(28, 28, 28, .14);
}
.menu__lista a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.menu__lista a:hover { background: var(--hueso); }
.menu__nota { padding: 6px 12px 4px; font-size: 12px; color: var(--texto-suave); }

.importar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.importar__botones { display: flex; flex-wrap: wrap; gap: 8px; }
.importar__ayuda summary { cursor: pointer; font-weight: 700; font-size: 14px; min-height: 32px; }
.importar__ayuda ul { margin: 8px 0 0; padding-left: 18px; list-style: disc; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.subir {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 140px; padding: 20px; border: 2px dashed var(--linea); border-radius: 16px; background: var(--hueso); cursor: pointer;
  font-size: 13px; color: var(--texto-suave);
}
.subir strong { font-size: 16px; color: var(--texto); text-decoration: underline; text-underline-offset: 3px; }
.subir:focus-within, .subir:hover { border-color: var(--carbon); }
.subir.has-archivo { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }

.import-resumen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.import-dato { background: var(--hueso); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.import-dato b { font-size: 30px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.import-dato span { font-size: 13px; color: var(--texto-suave); }
.import-dato.is-error { background: var(--error-bg); }
.import-dato.is-error b, .import-dato.is-error span { color: var(--error); }
.card__head--pad { padding: 18px 22px 0; margin-bottom: 4px; flex-wrap: wrap; }
.import-motivos { white-space: normal !important; color: var(--error); font-size: 14px; }
.import-revision { display: flex; flex-direction: column; gap: var(--gap); }
.import-acciones { margin-top: var(--gap); align-items: center; flex-wrap: wrap; }

/* =========================================================
   Clientes y fidelización
   ========================================================= */
.pos-cliente__fid { margin-left: auto; padding: 3px 8px; border-radius: 8px; background: var(--hueso); font-size: 12px; font-weight: 700; color: var(--texto-suave); white-space: nowrap; }
.pos-cliente__fid.is-premio { background: var(--naranja); color: var(--carbon); }
.cli-fid { display: inline-block; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--texto-suave); }
.cli-fid.is-premio { color: var(--ok); }
.cobro-premio { padding: 10px 14px; border: 2px solid var(--naranja); border-radius: 14px; background: var(--naranja-suave); }
.cobro-premio .check { font-weight: 700; }
.listo__fid { padding: 10px 14px; border-radius: 12px; background: var(--hueso); font-weight: 700; font-size: 15px; }
.listo__fid.is-premio { background: var(--naranja); color: var(--carbon); }

.fid-tarjeta { padding: 18px; border-radius: 18px; background: var(--carbon); color: var(--blanco); display: flex; flex-direction: column; gap: 12px; }
.fid-tarjeta__titulo { font-weight: 900; font-size: 15px; color: var(--naranja); }
.fid-tarjeta__texto { font-size: 14px; color: #D9D2CC; }
.fid-tarjeta__texto strong { color: var(--blanco); }
.fid-sellos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.fid-sello { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #5A5550; }
.fid-sello.is-lleno { border: 0; background: var(--naranja); }
.fid-sello.is-premio { border-style: solid; border-color: var(--naranja); position: relative; }
.fid-sello.is-premio::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--naranja); font-size: clamp(12px, 2vw, 18px); }
.fid-sello.is-premio.is-lleno::after { color: var(--carbon); }
.fid-tarjeta--grande .fid-sellos { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); max-width: 520px; }
.fid-premio-listo { padding: 8px 12px; border-radius: 10px; background: var(--naranja); color: var(--carbon); font-weight: 900; }

.mini-sellos { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.mini-sellos__barra { width: 64px; height: 8px; border-radius: 4px; background: var(--hueso); overflow: hidden; }
.mini-sellos__barra i { display: block; height: 100%; background: var(--naranja); border-radius: 4px; }

.cliente { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.cliente__datos { grid-column: span 7; display: flex; flex-direction: column; gap: 16px; }
.cliente__stats { grid-column: span 5; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.cliente__fid { grid-column: span 7; }
.cliente__fav { grid-column: span 5; }
.cliente__compras { grid-column: span 12; }
.cliente__notas { padding: 10px 12px; border-radius: 10px; background: var(--hueso); font-size: 14px; }
.cliente__productos { white-space: normal !important; font-size: 13px; color: var(--texto-suave); max-width: 420px; }
.cliente__movs summary { cursor: pointer; font-weight: 700; font-size: 14px; min-height: 32px; }
.stat__value--sm { font-size: 20px !important; }
.input-suffix--dv span { font-weight: 700; }

/* =========================================================
   Reportes
   ========================================================= */
.reportes { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.reportes__menu { padding: 8px; position: sticky; top: 96px; }
.reportes__selector { display: none; }
.reportes__lista { display: flex; flex-direction: column; gap: 2px; }
.reportes__lista a { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 12px; }
.reportes__lista a:hover { background: var(--hueso); }
.reportes__lista a strong { font-size: 14px; }
.reportes__lista a span { font-size: 12px; color: var(--texto-suave); line-height: 1.35; }
.reportes__lista a.is-active { background: var(--carbon); color: var(--blanco); }
.reportes__lista a.is-active span { color: #C9C1BA; }
.reportes__contenido { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.reporte-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.reporte-cab h2 { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.reporte-cab + .toolbar { margin: 0; }
.reporte-resumen { margin: 0; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.reporte-resumen .stat__value { font-size: clamp(20px, 2.2vw, 28px); }
.reporte-sub { font-size: 16px; font-weight: 700; }
.reporte-nota { margin: 10px 22px 0; }
.reporte-tabla tfoot th, .reporte-tabla tfoot td { padding: 12px; border-top: 2px solid var(--carbon); font-weight: 900; white-space: nowrap; }
.reporte-tabla tfoot th { text-align: left; padding-left: 0; }

/* Gráfica de columnas (series de tiempo) */
.grafica-col { display: flex; align-items: flex-end; gap: 4px; height: 240px; padding: 22px 0 28px; overflow-x: auto; overflow-y: visible; }
.grafica-col__item { flex: 1 0 18px; max-width: 64px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.grafica-col__barra { width: 100%; background: var(--naranja); border-radius: 6px 6px 0 0; min-height: 2px; transition: background .15s; }
.grafica-col__item:hover .grafica-col__barra { background: var(--carbon); }
.grafica-col__et { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--texto-suave); white-space: nowrap; }
.grafica-col__item:first-child .grafica-col__et { left: 0; transform: none; }
.grafica-col__valor { position: absolute; top: -18px; font-size: 10px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.grafica-col__item:hover .grafica-col__valor { opacity: 1; }
/* Gráfica de barras (rankings) */
.grafica-bar { display: flex; flex-direction: column; gap: 10px; counter-reset: gb; }
.grafica-bar li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; }
.grafica-bar__et { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.grafica-bar__pista { height: 14px; background: var(--hueso); border-radius: 7px; overflow: hidden; }
.grafica-bar__pista i { display: block; height: 100%; background: var(--naranja); border-radius: 7px; }
.grafica-bar li:first-child .grafica-bar__pista i { background: var(--carbon); }

@media print {
  .reportes { display: block; }
  .reportes__menu, .no-imprimir { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  .content { padding: 0; }
}

/* Estado vacío / sin acceso */
.empty { max-width: 520px; margin: 40px auto; text-align: center; padding: 40px 28px; }
.empty h2 { font-size: 22px; font-weight: 900; letter-spacing: -.015em; }
.empty p { color: var(--texto-suave); margin: 8px 0 22px; }
.empty--inline { margin: 0 auto; max-width: 460px; }

/* =========================================================
   Responsive
   ========================================================= */

/* Escritorio mediano */
@media (max-width: 1320px) {
  .user__text { display: none; }
  .hero { grid-column: span 12; }
  .kpis { grid-column: span 12; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
  .mesas { grid-column: span 12; }
  .fe { grid-column: span 12; }
  .fe__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top, .stock { grid-column: span 6; }
  .pagos { grid-column: span 12; }
}

/* Tablet: el sidebar pasa a rail */
@media (max-width: 1100px) {
  .app:not(.is-expanded) .sidebar { width: var(--sidebar-rail); }
  .app:not(.is-expanded) .logo-full { display: none; }
  .app:not(.is-expanded) .logo-icon { display: block; }
  .app:not(.is-expanded) .sidebar__brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .app:not(.is-expanded) .nav__item { justify-content: center; padding: 0; position: relative; }
  .app:not(.is-expanded) .nav__item span,
  .app:not(.is-expanded) .local__text { display: none; }
  .app:not(.is-expanded) .nav__group { font-size: 0; padding: 10px 0 4px; border-top: 1px solid #333; margin: 8px 10px 0; }
  .app:not(.is-expanded) .nav__group:first-child { border-top: 0; margin-top: 0; }
  .app:not(.is-expanded) .nav__badge { position: absolute; top: 9px; right: 12px; min-width: 0; width: 10px; height: 10px; padding: 0; font-size: 0; border: 2px solid var(--carbon); }
  .app:not(.is-expanded) .local { justify-content: center; padding: 8px 0; }

  .topbar { padding: 12px 24px; }
  .content { padding: 24px 24px 40px; }
  .search { display: none; }
  .toolbar .search--inline { display: flex; }

  .form-layout { grid-template-columns: 1fr; }
  .prod-layout { grid-template-columns: 1fr; }
  .form-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload { aspect-ratio: 4 / 3; }
  .reportes { grid-template-columns: 1fr; }
  .reportes__menu { position: static; padding: 0; border: 0; background: none; }
  .reportes__lista { display: none; }
  .reportes__selector { display: block; }
  .cliente__datos, .cliente__stats, .cliente__fid, .cliente__fav { grid-column: span 12; }
  .editor { grid-template-columns: 1fr; }
  .editor__panel { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .caja-efectivo, .caja-ventas { grid-column: span 12; }
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* Móvil: sidebar como panel deslizable */
@media (max-width: 767px) {
  :root { --gap: 14px; }

  .sidebar,
  .app:not(.is-expanded) .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform .25s ease;
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .app.is-open .sidebar { transform: translateX(0); }

  /* En móvil el panel siempre se ve completo */
  .app .sidebar .logo-full { display: block !important; }
  .app .sidebar .logo-icon { display: none !important; }
  .app .sidebar .sidebar__brand { justify-content: space-between !important; padding: 0 10px 22px !important; }
  .app .sidebar .nav__item { justify-content: flex-start !important; padding: 0 12px !important; }
  .app .sidebar .nav__item span,
  .app .sidebar .local__text { display: flex !important; }
  .app .sidebar .nav__group { font-size: 12px !important; padding: 18px 12px 6px !important; border-top: 0 !important; margin: 0 !important; }
  .app .sidebar .nav__badge { position: static !important; width: auto !important; min-width: 22px !important; height: 22px !important; padding: 0 6px !important; font-size: 12px !important; border: 0 !important; }
  .app .sidebar .local { justify-content: flex-start !important; padding: 8px 12px !important; }
  .icon-btn.sidebar__close { display: grid; }

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 28, 28, .5);
    z-index: 35;
  }

  .topbar {
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    gap: 6px;
  }
  .icon-btn.topbar__menu { display: grid; }
  .icon-btn.topbar__collapse { display: none; }
  .topbar__title h1 { font-size: 18px; }
  .topbar__title p { font-size: 12px; }
  .topbar__actions { gap: 2px; }
  .topbar__actions .pill { display: none; }
  .user { padding: 3px; }
  .topbar__actions .btn--primary span { display: none; }
  .topbar__actions .btn--primary { width: 44px; padding: 0; }

  .content { padding: 16px 14px calc(32px + env(safe-area-inset-bottom, 0px)); }

  .card { padding: 18px; border-radius: 18px; }
  .hero { padding: 20px 18px 16px; }
  .hero__head { flex-direction: column; }
  .segmented { align-self: stretch; }
  .segmented button { flex: 1; }
  .chart { gap: 4px; height: 150px; }
  .chart__axis { gap: 4px; font-size: 11px; }
  .chart__bar { border-radius: 4px 4px 0 0; }
  .chart__bar.is-peak::after { font-size: 11px; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 24px; }
  .kpi--caja { grid-column: span 2; }

  .card__head { flex-wrap: wrap; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .mesas__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mesa { min-height: 80px; padding: 10px 12px; }

  .fe__list { display: flex; }
  .top, .stock { grid-column: span 12; }

  .table-wrap { margin: 0 -18px; padding: 0 18px; }

  /* Tablas que se vuelven tarjetas */
  .card--flush .table-wrap { padding: 0; }
  .table--cards { min-width: 0; }
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody { display: block; }
  .table--cards tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--linea);
  }
  .table--cards td { display: block; padding: 0 !important; border: 0; white-space: normal; text-align: left !important; }
  .table--cards td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--texto-suave); margin-bottom: 2px; }
  .table--cards .cell-main { grid-column: 1 / -1; }
  .table--cards td.cell-actions { grid-column: 1 / -1; display: flex; justify-content: flex-start; gap: 8px; }
  .table--cards td.cell-actions:empty { display: none; }
  .table--cards td.cell-actions form { margin: 0; }
  .table--cards td.cell-actions .btn { min-height: 44px; }
  .table tbody tr:hover td { background: none; }

  .toolbar .select { flex: 1 1 calc(50% - 5px); }
  .toolbar .btn { flex: 1 1 100%; }
  .page-head .btn--primary { flex: 1 1 100%; }
  .subnav { flex: 1 1 100%; }
  .subnav a { flex: 1; justify-content: center; }

  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .receta__fila { grid-template-columns: minmax(0, 1fr) 120px 44px; }
  .receta__head { display: none; }
  .choice--cards { grid-template-columns: 1fr; }
  .choice--cards .choice__opt span { min-height: 60px; }
  .kardex-head { grid-template-columns: 1fr; }
  .kardex-head__datos { gap: 18px; }
  .kardex-head__acciones .btn { flex: 1 1 auto; }
  .field--compact { flex: 1 1 calc(50% - 5px); flex-direction: column; align-items: stretch; gap: 4px; }
  .page-head__actions { flex: 1 1 100%; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .calc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; }
  .form-actions .btn--primary { flex-basis: 100%; order: -1; }
  .danger { flex-direction: column; align-items: stretch; }
  .modal__box { padding: 18px; }

  .date { flex: 1 1 calc(50% - 5px); }
  .date input { min-width: 0; width: 100%; }
  .linea { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .linea__total strong { font-size: 16px; }
  .doc__head { grid-template-columns: 1fr; }
  .doc__totales div { min-width: 0; width: 100%; }

  .form-aside { grid-template-columns: 1fr; }
  .caja-cerrada { grid-template-columns: 1fr; }
  .grafica-bar li { grid-template-columns: 1fr auto; }
  .grafica-bar__pista { grid-column: 1 / -1; grid-row: 2; }
  .cliente__datos, .cliente__stats, .cliente__fid, .cliente__fav { grid-column: span 12; }
  .importar { grid-template-columns: 1fr; }
  .import-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .codigos { grid-template-columns: 1fr; }
  .temporal__clave code { font-size: 18px; }
  .editor { grid-template-columns: 1fr; }
  .editor__panel { position: static; }
  .kds-opciones .switch span:last-child { font-size: 13px; }
  .plano-wrap { padding: 10px; }
  .caja-efectivo, .caja-ventas, .caja-movs, .caja-arqueos { grid-column: span 12; }
  .conteo { grid-template-columns: 1fr; gap: 16px; }
  .conteo__fila, .conteo__fila--otro { grid-template-columns: 72px minmax(0, 1fr) 84px; padding: 4px; }
}

/* POS en tablet vertical y móvil: la cuenta se abre como panel */
@media (max-width: 900px) {
  .pos { grid-template-columns: 1fr; height: calc(100dvh - 90px - 72px); }
  .pos__cuenta {
    position: fixed;
    inset: 0;
    z-index: 45;
    border-radius: 0;
    border: 0;
    transform: translateY(100%);
    transition: transform .25s ease;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .pos__cuenta.is-abierta { transform: translateY(0); }
  .icon-btn.pos-cuenta__cerrar { display: grid; }
  .pos-vercuenta {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 0 20px;
    border: 0;
    border-radius: 16px;
    background: var(--naranja);
    color: var(--carbon);
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 8px 24px rgba(28, 28, 28, .25);
  }
  .pos-vercuenta strong { font-size: 20px; font-weight: 900; }
  .pos__grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding-bottom: 90px; }
  .pagina-pos .content { padding: 12px; }
}
/* En tablet vertical el menú lateral queda como rail: la barra no debe quedar debajo */
@media (min-width: 768px) and (max-width: 900px) {
  .pos-vercuenta { left: calc(var(--sidebar-rail) + 12px); }
}
@media (max-width: 767px) {
  .pos__barra .btn { display: none; }
  .pos { height: calc(100dvh - 70px - 24px); }
}

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