/* ---------- Panel de stock ---------- */
body { background: var(--cream-2); }
@media (min-width: 760px) { body { background: var(--sage-100); } }
.app { max-width: 720px; margin: 0 auto; background: var(--cream); min-height: 100dvh; padding-bottom: 104px; }
@media (min-width: 760px) { .app { margin: 24px auto; min-height: auto; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-2); padding-bottom: 0; } }

.appbar {
  background: var(--sage-800); color: #fff; padding: 14px var(--gutter) 22px;
  background-image: radial-gradient(circle at 100% 0, rgba(217, 130, 91, .35), transparent 50%);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
@media (min-width: 760px) { .appbar { border-radius: 0; padding: 20px 28px 28px; } }
.appbar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand.light { color: #fff; }
.brand.light .brand-mark { width: 34px; height: 34px; }
.brand.light .brand-sub { color: #c9d8c6; display: block; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: #d9e5d6; background: rgba(255, 255, 255, .08); padding: 6px 10px; border-radius: 999px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: #8fe0a0; box-shadow: 0 0 0 3px rgba(143, 224, 160, .25); }

.saved { margin-top: 20px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r-lg); padding: 18px; }
.saved-label { font-size: .85rem; color: #d9e5d6; font-weight: 500; }
.saved-num { font-family: var(--font-serif); font-size: 3.2rem; line-height: 1; margin-top: 6px; font-weight: 600; letter-spacing: -.02em; }
.saved-num .unit { font-size: 1.3rem; font-weight: 500; color: #f6c9b0; }
.saved-sub { font-size: .9rem; color: #d9e5d6; margin-top: 8px; }
.saved-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.saved-stats div { background: rgba(0, 0, 0, .12); border-radius: 14px; padding: 10px; }
.saved-stats b { display: block; font-size: 1.25rem; }
.saved-stats span { display: block; font-size: .72rem; line-height: 1.3; color: #d0dccd; margin-top: 2px; }

.content { padding: 18px var(--gutter) 24px; display: grid; gap: 26px; }
@media (min-width: 760px) { .content { padding: 26px 28px 30px; } }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.row-head h2 { font-size: 1.3rem; color: var(--sage-900); }
.count-pill { min-width: 28px; height: 28px; padding: 0 9px; border-radius: 999px; background: var(--bad); color: #fff; font-weight: 700; display: inline-grid; place-items: center; font-size: .85rem; }
.muted { color: var(--muted); font-size: .9rem; }

.alert-list { display: grid; gap: 8px; }
.alert {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  background: var(--paper); border-radius: var(--r-md); padding: 12px 14px; border-left: 5px solid var(--warn);
  box-shadow: var(--shadow-1);
}
.alert.out { border-left-color: var(--bad); }
.alert-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); }
.alert.out .alert-ic { background: var(--bad-bg); color: var(--bad); }
.alert-ic svg { width: 18px; height: 18px; }
.alert b { display: block; font-size: .95rem; line-height: 1.3; }
.alert small { color: var(--muted); font-size: .82rem; }
.alert-units { font-weight: 700; font-size: 1.05rem; text-align: right; line-height: 1.1; }
.alert-units small { display: block; font-weight: 500; }
.all-good { background: var(--ok-bg); color: var(--ok); border-radius: var(--r-md); padding: 14px; font-weight: 600; }

.search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
}
.search:focus-within { border-color: var(--sage-600); box-shadow: 0 0 0 4px var(--sage-100); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; height: 100%; font-size: 1rem; }
.tabs { display: flex; gap: 8px; margin: 12px calc(var(--gutter) * -1) 0; padding: 2px var(--gutter); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.hint { font-size: .82rem; color: var(--muted); margin: 10px 0 12px; }

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px;
}
.item-name { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.item-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.item-right { display: flex; align-items: center; gap: 10px; }
.units { text-align: right; min-width: 42px; }
.units b { font-size: 1.3rem; display: block; line-height: 1; }
.units small { font-size: .72rem; color: var(--muted); }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--cream-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); transition: width .25s ease; }
.item.low .bar i { background: #d79a2b; }
.item.out .bar i { background: var(--bad); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.low { background: var(--warn-bg); color: var(--warn); }
.status.out { background: var(--bad-bg); color: var(--bad); }
.stepper { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; }
.stepper button { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 50%; font-size: 1.15rem; color: var(--sage-800); }
.stepper button:hover { background: var(--sage-100); }
.item-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

.disclaimer { font-size: .8rem; color: var(--muted); text-align: center; }

.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 70%, rgba(251, 247, 240, 0));
}
@media (min-width: 760px) { .cta-bar { position: sticky; bottom: 0; padding: 14px 28px 22px; } }
.cta-bar .btn { min-height: 56px; font-size: 1.05rem; box-shadow: 0 8px 24px rgba(217, 130, 91, .35); max-width: 720px; margin: 0 auto; }
.cta-n { background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 2px 9px; font-size: .85rem; }
.cta-n:empty { display: none; }
.demo-badge { bottom: 92px; }
@media (min-width: 760px) { .demo-badge { bottom: 12px; } }

/* Pedido */
dialog.order { width: min(600px, calc(100vw - 16px)); }
.order-intro { color: var(--muted); font-size: .92rem; margin-bottom: 14px; }
.group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px; }
.group h3 { font-family: var(--font-sans); font-size: .95rem; font-weight: 700; color: var(--sage-800); margin-bottom: 8px; }
.oline { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.oline:first-of-type { border-top: 0; }
.oline span { font-size: .9rem; line-height: 1.3; }
.oline small { display: block; color: var(--muted); font-size: .76rem; }
.oline input { width: 68px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px; text-align: center; font-weight: 700; background: var(--paper); }
.order-text { display: grid; gap: 6px; margin-top: 14px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.order-text textarea { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px; font: 400 .86rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--cream); resize: vertical; }
.order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.empty-order { padding: 14px; background: var(--ok-bg); color: var(--ok); border-radius: var(--r-md); font-weight: 600; }

/* Evitar desbordes horizontales en móvil */
.content > * { min-width: 0; }
.item { grid-template-columns: minmax(0, 1fr) auto; }
.alert { grid-template-columns: auto minmax(0, 1fr) auto; }
