:root {
  --bg: #101512;
  --bg-2: #171e1b;
  --card: rgba(255, 250, 242, 0.045);
  --card-solid: #1b2420;
  --line: rgba(244, 236, 220, 0.1);
  --ink: #f6f1e7;
  --muted: #b4c0b8;
  --faint: #7f8d86;
  --teal: #2fbe8a;
  --teal-deep: #0e6b50;
  --teal-soft: rgba(47, 190, 138, 0.16);
  --amber: #e4b15a;
  --amber-soft: rgba(228, 177, 90, 0.16);
  --red: #e56d6d;
  --red-soft: rgba(229, 109, 109, 0.16);
  --radius: 22px;
  --nav: 78px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); font-family: var(--font); }
body {
  background:
    radial-gradient(520px 280px at 80% 8%, rgba(228, 177, 90, 0.13), transparent 60%),
    radial-gradient(680px 360px at 0% 0%, rgba(47, 190, 138, 0.2), transparent 55%),
    linear-gradient(180deg, #14201c 0%, #0c1210 42%, #101512 100%);
}
.nav button { display: grid; justify-items: center; gap: 2px; }
.nav button i { font-style: normal; font-size: 15px; line-height: 1; }
.login {
  max-width: 520px; margin: 4vh auto; padding: 28px 22px 22px;
  border-radius: 32px; border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,250,242,.07), rgba(255,250,242,.03));
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0; color: var(--amber); letter-spacing: .18em; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.login h2 { font-family: var(--display); font-size: 46px; line-height: .95; margin: 8px 0 8px; font-weight: 560; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.person {
  display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px;
  text-align: left; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--ink);
}
.person b { grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: #d8ffef; }
.person span { font-weight: 650; }
.person small, .hint { color: var(--faint); font-size: 12px; }
.hint { text-align: center; margin: 12px 0 0; }
.qty { font-family: var(--display); font-size: 22px; }
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
.app { width: min(1080px, 100%); margin: 0 auto; padding: 18px 16px calc(var(--nav) + 28px); }
.top {
  display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 28px;
  background: rgba(16, 21, 18, 0.72); backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 46px; height: 46px; border-radius: 16px;
  background: linear-gradient(160deg, #49d7a4, #0e6b50);
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.mark span { width: 16px; height: 16px; position: relative; }
.mark span::before, .mark span::after { content: ""; position: absolute; background: #f6f1e7; border-radius: 4px; }
.mark span::before { width: 16px; height: 5px; left: 0; top: 5.5px; }
.mark span::after { width: 5px; height: 16px; left: 5.5px; top: 0; }
.brand h1 { font-family: var(--display); font-size: 22px; font-weight: 560; margin: 0; letter-spacing: -0.03em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.local-select, .field input, .field select, .search input {
  background: #121916; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline: none; width: 100%;
}
.local-select { width: auto; max-width: 220px; }
.field input:focus, .field select:focus, .search input:focus, .local-select:focus { border-color: rgba(47, 190, 138, .7); box-shadow: 0 0 0 4px rgba(47, 190, 138, .12); }
.sync-pill { border: 1px solid var(--line); background: #121916; color: var(--muted); border-radius: 999px; padding: 9px 12px; font-size: 11px; font-weight: 700; }
.sync-pill.live { color: #b7ecd6; border-color: rgba(47, 190, 138, .4); }
.sync-pill.bad { color: #ffc1c1; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi, .card {
  background: linear-gradient(180deg, rgba(255,250,242,.05), rgba(255,250,242,.025));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.kpi { min-height: 104px; }
.kpi .label, .sub, .muted { color: var(--muted); font-size: 12px; line-height: 1.4; }
.kpi .value, .qty { font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.kpi .value { font-family: var(--display); font-size: 28px; margin-top: 8px; }
.kpi.bad { background: linear-gradient(180deg, rgba(229,109,109,.16), rgba(255,250,242,.03)); }
.kpi.warn { background: linear-gradient(180deg, rgba(228,177,90,.16), rgba(255,250,242,.03)); }
.kpi.good { background: linear-gradient(180deg, rgba(47,190,138,.18), rgba(255,250,242,.03)); }
.card { margin-bottom: 12px; }
.card h2, .card h3, .section-h h2 { font-family: var(--display); letter-spacing: -0.03em; }
.card h3 { margin: 0; font-size: 18px; font-weight: 560; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.section-h h2 { font-size: 20px; margin: 0; }
.actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.btn, .btn-ghost, .btn-danger { border: 0; border-radius: 16px; padding: 14px 14px; font-weight: 650; letter-spacing: -0.01em; }
.btn { background: linear-gradient(180deg, #3dca96, #14966c); color: #062117; box-shadow: 0 8px 18px rgba(20, 150, 108, .22); }
.btn.secondary { background: #202924; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.amber { background: linear-gradient(180deg, #f0c57a, #d7a24a); color: #231208; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-danger { background: var(--red-soft); color: #ffd7d7; }
.btn.full, .btn-ghost.full, .btn-danger.full { width: 100%; }
.btn:disabled { opacity: .4; box-shadow: none; }
.chips { display: flex; gap: 8px; overflow: auto; margin: 10px 0 14px; padding-bottom: 2px; }
.chip { border: 1px solid var(--line); background: #151c19; color: var(--muted); border-radius: 999px; padding: 9px 14px; white-space: nowrap; }
.chip.on, .people .chip { background: var(--teal-soft); color: var(--ink); border-color: transparent; }
.search { margin-bottom: 12px; }
.search input { font-size: 16px; border-radius: 18px; padding: 16px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 700; }
.badge.ok { background: var(--teal-soft); color: #b7ecd6; }
.badge.pronto { background: rgba(126,182,214,.16); color: #c5e4f5; }
.badge.critico, .badge.bajo { background: var(--amber-soft); color: #ffd89a; }
.badge.vencido { background: var(--red-soft); color: #ffc1c1; }
.lot, .list-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.lot { background: rgba(0,0,0,.22); border-radius: 14px; padding: 10px 12px; margin-top: 8px; font-size: 12px; }
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.nav {
  position: fixed; left: 12px; right: 12px; bottom: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 8px; background: rgba(16, 21, 18, .9); border: 1px solid var(--line); border-radius: 24px;
  backdrop-filter: blur(16px); z-index: 20; box-shadow: var(--shadow);
}
.nav button { background: transparent; border: 0; color: var(--faint); font-size: 11px; font-weight: 650; padding: 10px 0; border-radius: 16px; }
.nav button.on { color: #062117; background: var(--teal); }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: none; align-items: flex-end; justify-content: center; z-index: 40; }
.sheet.open { display: flex; }
.sheet .panel { width: min(560px, 100%); max-height: 92dvh; overflow: auto; background: #171e1b; border-radius: 28px 28px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); border: 1px solid var(--line); }
.sheet h2 { font-family: var(--display); margin: 2px 0 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 16px); transform: translateX(-50%); background: #f6f1e7; color: #17211d; padding: 12px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; display: none; z-index: 50; }
.toast.show { display: block; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
.note { color: var(--muted); background: rgba(0,0,0,.2); border-radius: 16px; padding: 12px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.bar { height: 9px; background: rgba(0,0,0,.28); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #14966c, #8ee0bf); }
.login { max-width: 460px; margin: 7vh auto; padding: 22px; }
.login h2 { font-family: var(--display); font-size: 36px; margin: 6px 0 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.key { border: 1px solid var(--line); background: #151c19; border-radius: 16px; padding: 16px 0; font-size: 20px; font-weight: 700; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.people .chip { width: 100%; text-align: left; padding: 14px; border-radius: 16px; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav) + 12px); z-index: 30;
  border: 0; border-radius: 999px; padding: 14px 18px; font-weight: 700;
  background: linear-gradient(180deg, #3dca96, #14966c); color: #062117;
  box-shadow: 0 12px 28px rgba(20, 150, 108, .35);
}
.fab[hidden] { display: none; }
@media (min-width: 860px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .stock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .stock-grid .card { margin: 0; }
  .sheet { align-items: center; }
  .sheet .panel { border-radius: 28px; }
  .nav { left: 50%; right: auto; width: min(720px, calc(100% - 24px)); transform: translateX(-50%); grid-template-columns: repeat(6, 1fr); }
}
@media print { .nav, .top-actions, .btn, .actions { display: none !important; } body { background: white; color: black; } }
