:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --border: #e8e8ec;
  --text: #0b0b0f;
  --muted: #6e6e7a;
  --ink: #0b0b0f;
  --accent: #d24c0f;
  --accent-2: #f97316;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee6;
  --grad: linear-gradient(120deg, #d24c0f 0%, #f97316 55%, #fbbf24 100%);
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --warn: #b45309;
  --warn-soft: #fef5e1;
  --bad: #e11d48;
  --bad-soft: #ffe8ee;
  --info: #2563eb;
  --info-soft: #e8f0ff;
  --radius: 16px;
  --shadow: 0 1px 1px rgba(11, 11, 15, .03), 0 8px 24px -8px rgba(11, 11, 15, .08);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent;
}
/* logo bordado de fondo, muy difuminado */
body::before {
  content: ""; position: fixed; inset: -4%; z-index: -1; pointer-events: none;
  background: url("logo-fondo.webp") center var(--bg-y, 70%) / calc(min(100vw, 960px) * var(--bg-size, 1.5)) auto no-repeat;
  opacity: var(--bg-op, .17); filter: grayscale(1);
}
.no-bg body::before { display: none; }
/* fondo propio subido por el dueño: foto a pantalla completa, en color */
.has-bg-img body::before { inset: 0; background: var(--bg-img) center / cover no-repeat; filter: none; }
/* en celular el logo de fondo va más abajo */
@media (max-width: 600px) { body::before { background-position: center calc(min(calc(var(--bg-y, 70%) + 18%), 100%) + 1cm); background-size: calc(100vw * var(--bg-size, 1.5) * .6 - 2cm) auto; } }
@media print { body::before { display: none; } }
input.range { padding: 0; min-height: 32px; border: 0; background: none; box-shadow: none; accent-color: var(--accent); cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.025em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; letter-spacing: -.01em; }
body { font-feature-settings: "cv11", "ss01"; }
::selection { background: #fde3d4; }

/* logo e iconos */
.logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.logo svg, .logo-img { flex: none; display: block; }
.logo-img { border-radius: 12px; object-fit: cover; background: #000; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo-word { display: flex; flex-direction: column; line-height: 1; }
.logo-word b { font-family: var(--display); font-weight: 600; font-size: 1.05rem; letter-spacing: -.02em; }
.logo-word small { font-size: .62rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); margin-top: .3rem; }
.i { width: 1.25em; height: 1.25em; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-size: .7rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* botones */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: .6rem 1rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; font-weight: 600; text-decoration: none; transition: transform .1s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  touch-action: manipulation; user-select: none; letter-spacing: -.005em;
}
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 6px 18px -8px rgba(210, 76, 15, .55), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--bad); border-color: var(--bad-soft); background: var(--bad-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: .35rem .7rem; font-size: .9rem; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; padding: 0; }
@media (hover: hover) {
  button:hover:not(:disabled), .btn:hover { border-color: #cfd0db; }
  .btn-primary:hover:not(:disabled) { background: #1f1f2b; border-color: #1f1f2b; }
}

/* formularios */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
input, select, textarea {
  font: inherit; font-size: 16px; width: 100%; padding: .65rem .8rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); min-height: 44px; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(210, 76, 15, .12); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { margin-bottom: .9rem; }
.row { display: flex; gap: .75rem; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--text); font-size: 1rem; }
.check input { width: 22px; height: 22px; min-height: 0; }

/* tarjetas y chips */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem;
  font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; letter-spacing: .01em;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-accent { background: var(--accent-soft); color: var(--accent); }

/* modal / hoja inferior */
.overlay {
  position: fixed; inset: 0; background: rgba(11, 11, 15, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; border-radius: 20px 20px 0 0;
  padding: 1.2rem 1rem calc(1rem + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 20px; padding-bottom: 1.2rem; }
}
/* panel lateral (cobrar): en computadora ocupa de la mitad de la pantalla al borde derecho */
@media (min-width: 861px) {
  .overlay.side { justify-content: flex-end; align-items: stretch; }
  .overlay.side .sheet { width: 50vw; max-width: none; height: 100dvh; max-height: none; border-radius: 22px 0 0 22px;
    padding: 1.6rem 2rem 1.6rem; box-shadow: -24px 0 48px -24px rgba(11, 11, 15, .35); animation: slide-in .25s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .overlay, .sheet { animation: none; } }

/* avisos */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: .5rem; width: min(92vw, 420px); }
.toast { background: rgba(11, 11, 15, .92); backdrop-filter: blur(8px); color: #fff; padding: .75rem 1rem; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; animation: up .2s ease; }
.toast.bad { background: var(--bad); color: #fff; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.stars { color: #f59e0b; letter-spacing: 1px; }
