/* Kit72 — estilos */
:root {
  --bg: #F4F0E8;
  --card: #FFFDF9;
  --ink: #1C1A16;
  --muted: #7A7468;
  --line: #E7E0D3;
  --soft: #ECE6DA;
  --accent: #FF5B24;
  --accent-2: #FF8A3D;
  --ok: #1E8E62;      --ok-bg: #DDF3E7;
  --warn: #A66100;    --warn-bg: #FFE8B8;
  --bad: #C6281C;     --bad-bg: #FFDCD6;
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 8px 24px rgba(40, 30, 10, .06);
  --r: 22px;
  --tab-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110F;
    --card: #1D1B18;
    --ink: #F4EFE6;
    --muted: #9C958A;
    --line: #2E2B26;
    --soft: #26231F;
    --ok: #5FD3A2;    --ok-bg: #12382A;
    --warn: #F5BE54;  --warn-bg: #3F2E08;
    --bad: #FF8A7E;   --bad-bg: #431714;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

#app { max-width: 540px; margin: 0 auto; min-height: 100dvh; }
#view {
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(var(--tab-h) + var(--safe-b) + 40px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Cabeceras ---------- */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.top h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; flex: 1; line-height: 1.1; }
.top .sub { color: var(--muted); font-size: 14px; font-weight: 500; margin-top: 2px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff;
  font-weight: 900; font-size: 17px; letter-spacing: -.03em;
  box-shadow: 0 6px 16px rgba(255, 91, 36, .35);
}
.brand b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 18px; flex: none;
}
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.section-h h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.section-h span, .section-h button { color: var(--muted); font-size: 14px; font-weight: 600; }
.section-h button { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  border-radius: 28px; padding: 22px 22px 20px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #FF5B24, #FF9A3D);
  box-shadow: 0 14px 34px rgba(255, 91, 36, .28);
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.hero.ok   { background: linear-gradient(140deg, #14805A, #35B98A); box-shadow: 0 14px 34px rgba(20, 128, 90, .28); }
.hero.warn { background: linear-gradient(140deg, #E07A00, #F7B32B); box-shadow: 0 14px 34px rgba(224, 122, 0, .28); }
.hero.bad  { background: linear-gradient(140deg, #B81D12, #F0553A); box-shadow: 0 14px 34px rgba(184, 29, 18, .28); }
.hero .eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.hero h2 { font-size: 30px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 6px; max-width: 12em; position: relative; z-index: 1; }
.hero p { font-size: 15px; opacity: .92; max-width: 22em; position: relative; z-index: 1; }
.hero .btn { margin-top: 16px; background: #fff; color: #1C1A16; position: relative; z-index: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); text-align: left; }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---------- Tarjetas y filas ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card.pad { padding: 16px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--soft); }
.row-main { flex: 1; min-width: 0; display: block; }
.row-title { display: block; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: block; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb {
  width: 52px; height: 52px; border-radius: 15px; object-fit: cover; flex: none; background: var(--soft);
  display: grid; place-items: center; font-size: 25px;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px;
  font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--muted); flex: none;
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.cat-h { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 20px 6px 8px; }

/* ---------- Checklist del kit ---------- */
.progress { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s ease; }
.ess { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 2px; text-align: left; border-top: 1px solid var(--line); }
.ess .e-ic { font-size: 22px; width: 30px; text-align: center; flex: none; }
.ess .e-tx { flex: 1; min-width: 0; }
.ess .e-tx b { display: block; font-size: 15.5px; font-weight: 700; }
.ess .e-tx small { color: var(--muted); font-size: 13px; }
.ess .e-st { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line); flex: none; display: grid; place-items: center; font-size: 14px; font-weight: 900; color: var(--accent); }
.ess.done .e-st { border: 0; background: var(--ok); color: #fff; }
.ess.done .e-tx b { color: var(--muted); }

/* ---------- Zonas ---------- */
.search {
  width: 100%; height: 50px; border-radius: 16px; border: 0; background: var(--card); box-shadow: var(--shadow);
  padding: 0 16px 0 44px; font-size: 16px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A7468' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px 50%; background-size: 20px;
}
.search:focus { box-shadow: 0 0 0 3px rgba(255, 91, 36, .35), var(--shadow); }
.zgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.zone {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; text-align: left;
  min-height: 132px; display: flex; flex-direction: column; position: relative; transition: transform .12s;
}
.zone:active { transform: scale(.97); }
.zone .z-ic { font-size: 32px; line-height: 1; }
.zone b { font-size: 17px; font-weight: 800; margin-top: auto; line-height: 1.15; letter-spacing: -.01em; }
.zone small { color: var(--muted); font-size: 13.5px; font-weight: 600; margin-top: 3px; }
.zone .z-alert { position: absolute; top: 14px; right: 14px; }
.zone.new { background: none; box-shadow: none; border: 2px dashed var(--line); align-items: center; justify-content: center; color: var(--muted); font-weight: 700; gap: 6px; }
.zone.new span { font-size: 28px; color: var(--accent); line-height: 1; }
.note { color: var(--muted); font-size: 14.5px; margin: -8px 4px 14px; }

/* ---------- Vacíos ---------- */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .big { font-size: 46px; line-height: 1; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.empty p { font-size: 15px; max-width: 22em; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: 17px; font-weight: 800; font-size: 16.5px; background: var(--accent); color: #fff;
  transition: transform .1s, opacity .2s; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 540px; z-index: 20;
  height: calc(var(--tab-h) + var(--safe-b)); padding: 6px 8px var(--safe-b);
  display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 700; height: 56px; justify-content: center; position: relative; }
.tab svg, .fab svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--accent); }
.fab {
  width: 62px; height: 62px; border-radius: 22px; margin: -26px auto 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px rgba(255, 91, 36, .45);
  transition: transform .12s;
}
.fab svg { width: 30px; height: 30px; stroke-width: 2.6; }
.fab:active { transform: scale(.92); }
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; font-style: normal; display: grid; place-items: center;
}

/* ---------- Hojas (modales inferiores) ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 12, 8, .5); display: flex; align-items: flex-end; justify-content: center;
  animation: bd .2s ease;
}
@keyframes bd { from { background: rgba(15, 12, 8, 0); } }
.sheet {
  width: 100%; max-width: 540px; max-height: 94dvh; overflow-y: auto; background: var(--bg);
  border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .28s cubic-bezier(.2, .9, .3, 1);
  overscroll-behavior: contain;
}
@keyframes up { from { transform: translateY(100%); } }
.backdrop.out { animation: bd .18s ease reverse forwards; }
.backdrop.out .sheet { animation: up .18s ease reverse forwards; }
.grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
.sheet-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-h h2 { flex: 1; font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.x { width: 38px; height: 38px; border-radius: 50%; background: var(--soft); font-size: 16px; font-weight: 700; flex: none; }

/* ---------- Formulario ---------- */
.field { margin-bottom: 18px; }
.label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 4px 8px; }
.label em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; }
.input, .select {
  width: 100%; height: 54px; border-radius: 16px; border: 2px solid transparent; background: var(--card);
  padding: 0 16px; font-size: 17px; font-weight: 600; outline: none; box-shadow: var(--shadow);
}
.input:focus, .select:focus { border-color: var(--accent); }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A7468' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shot {
  aspect-ratio: 1 / 1; border-radius: var(--r); border: 2px dashed var(--line); background: var(--card) center / cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  cursor: pointer; position: relative; overflow: hidden; padding: 10px;
}
.shot .s-ic { font-size: 34px; line-height: 1; }
.shot b { font-size: 15.5px; font-weight: 800; }
.shot small { color: var(--muted); font-size: 13px; }
.shot.has { border-style: solid; border-color: transparent; }
.shot.has > :not(.s-re) { display: none; }
.shot .s-re { display: none; }
.shot.has .s-re { display: block; position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 99px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.pick {
  padding: 10px 14px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: 15px;
  white-space: nowrap; border: 2px solid transparent; flex: none;
}
.pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.pick.sug { background: none; box-shadow: none; border: 2px dashed var(--line); color: var(--muted); }
.pick.ic { font-size: 22px; padding: 8px 12px; }
.qty { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 10px; }
.stepper { min-width: 0; display: flex; align-items: center; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); height: 54px; padding: 0 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 13px; background: var(--soft); font-size: 24px; font-weight: 700; line-height: 1; flex: none; }
.stepper button:active { background: var(--accent); color: #fff; }
.stepper input { flex: 1; min-width: 0; text-align: center; border: 0; background: none; font-size: 21px; font-weight: 800; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.big { height: 76px; border-radius: 22px; }
.stepper.big button { width: 60px; height: 60px; border-radius: 18px; font-size: 30px; }
.stepper.big input { font-size: 34px; }
.date3 { display: grid; grid-template-columns: .8fr 1.4fr 1fr; gap: 8px; }
.help { color: var(--muted); font-size: 13.5px; margin: 8px 4px 0; }
.switch { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; }
.switch span { flex: 1; font-weight: 700; }
.switch span small { display: block; color: var(--muted); font-weight: 500; font-size: 13.5px; }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }

/* ---------- Detalle de producto ---------- */
.d-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.d-photos.one { grid-template-columns: 1fr; }
.d-photos button { border-radius: var(--r); overflow: hidden; aspect-ratio: 1 / 1; position: relative; background: var(--soft); }
.d-photos.one button { aspect-ratio: 16 / 10; }
.d-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-photos span { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.d-emoji { font-size: 60px; text-align: center; padding: 14px 0 18px; line-height: 1; }
.d-status { border-radius: 18px; padding: 14px 16px; font-weight: 800; font-size: 17px; margin-bottom: 12px; background: var(--soft); }
.d-status small { display: block; font-weight: 600; font-size: 14px; opacity: .85; margin-top: 1px; }
.d-status.ok { background: var(--ok-bg); color: var(--ok); }
.d-status.warn { background: var(--warn-bg); color: var(--warn); }
.d-status.bad { background: var(--bad-bg); color: var(--bad); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fact { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.fact small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.fact b { font-size: 16.5px; font-weight: 800; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: grid; gap: 10px; }
.zoom { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .94); display: grid; place-items: center; animation: fade .2s; }
.zoom img { max-width: 100%; max-height: 100dvh; object-fit: contain; }

/* ---------- Reponer ---------- */
.rs { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.rs:last-child { border-bottom: 0; }
.rs .r-ic { font-size: 24px; width: 32px; text-align: center; flex: none; }
.addline { display: flex; gap: 8px; margin-bottom: 14px; }
.addline .input { flex: 1; }
.addline .btn { min-width: 54px; padding: 0 16px; font-size: 24px; }

/* ---------- Ajustes ---------- */
.set { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.set:last-child { border-bottom: 0; }
.set .s-tx { flex: 1; min-width: 0; }
.set .s-tx b { display: block; font-weight: 700; }
.set .s-tx small { color: var(--muted); font-size: 13.5px; }
.set .stepper { width: 150px; box-shadow: none; background: var(--soft); height: 48px; }
.set .stepper button { background: var(--card); width: 38px; height: 38px; }
.seg { display: flex; background: var(--soft); border-radius: 13px; padding: 3px; }
.seg button { padding: 8px 10px; border-radius: 10px; font-weight: 800; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tip { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.tip b { color: var(--ink); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px); transform: translate(-50%, 20px); z-index: 99;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-weight: 700; font-size: 15px;
  opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

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