:root {
  --bg: #f3efe6;
  --bg-2: #e7e1d4;
  --paper: #fffcf7;
  --ink: #1c1915;
  --muted: #6e675e;
  --line: #e3dacb;
  --green: #18493b;
  --green-2: #1f6b54;
  --mint: #e7f5ef;
  --gold: #f3d48a;
  --gold-ink: #7a5410;
  --terra: #b6402c;
  --terra-soft: #fde8e3;
  --blue: #1f4e79;
  --blue-soft: #e7eef6;
  --shadow: 0 12px 30px rgba(48, 36, 18, 0.06);
  --radius: 18px;
  --nav: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #efe4cf 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
:focus-visible { outline: 3px solid #e0a100; outline-offset: 2px; }
a { color: var(--green-2); }

.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 16px 40px;
  overflow: auto;
}
.login-card {
  margin: 0;
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 24px 22px;
}
.brand-logo { display: block; height: 46px; width: auto; max-width: 100%; margin: 0 0 14px; }
.logo-lockup { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--green); color: white;
  display: grid; place-items: center; flex: none;
}
.logo svg, .icon-btn svg, .nav-btn svg, .bottom-nav svg { width: 22px; height: 22px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3 { font-weight: 750; letter-spacing: -0.03em; }
h1 { font-size: 32px; margin: 0; }
h2 { font-size: 22px; margin: 0; }
.lead { color: var(--muted); margin: 8px 0 0; }
.terms-scroll { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 14px 0; background: #fff; }
.terms-card .terms-scroll { max-height: 420px; margin: 0; }
.terms-scroll h2 { font-size: 18px; margin-bottom: 8px; }
.terms-scroll h3 { font-size: 15px; margin: 16px 0 6px; }
.terms-scroll p, .terms-scroll li { font-size: 13px; line-height: 1.45; }
.terms-scroll ul, .terms-scroll ol { margin: 8px 0; padding-left: 18px; }
.terms-scroll li { margin: 6px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; font-size: 14px; }
.check input { margin-top: 3px; }
.login-card.plan-wide { width: min(820px, 100%); }
.plan-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}
.plan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 22px;
  padding: 26px 18px 20px;
  min-height: 420px;
  border: 2px solid transparent;
}
.plan-card:hover { transform: translateY(-2px); }
.plan-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.plan-icon { width: 72px; height: 72px; margin-bottom: 8px; }
.plan-price {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
}
.plan-price b {
  font-size: 64px;
  line-height: 0.85;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.plan-usd {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.05;
  margin-bottom: 6px;
}
.plan-usd small { font-size: 16px; font-weight: 650; }
.plan-note {
  margin-top: auto;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  max-width: 28ch;
}
.plan-save {
  display: block;
  width: calc(100% + 36px);
  margin: 0 -18px 16px;
  padding: 7px 12px;
  background: #c9a44a;
  color: #3a2c10;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.01em;
}
.plan-mensual {
  background:
    radial-gradient(140px 90px at 50% 62%, rgba(61, 204, 199, 0.28), transparent 72%),
    #0e2748;
  color: #fff;
  border-color: #d7deea;
  box-shadow: 0 16px 30px rgba(14, 39, 72, 0.18);
}
.plan-mensual .plan-price b,
.plan-mensual .plan-usd small { color: #3dccc7; }
.plan-mensual .plan-usd { color: #fff; }
.plan-mensual .plan-note { color: #f4f7fb; }
.plan-anual {
  background: #fffdf8;
  color: #102848;
  border-color: #c6a35a;
  box-shadow: 0 16px 30px rgba(120, 90, 30, 0.12);
}
.plan-anual .plan-price b,
.plan-anual .plan-name { color: #102848; }
.plan-anual .plan-usd { color: #102848; }
.plan-anual .plan-usd small { color: #a6843c; }
.plan-anual .plan-note { color: #1c1915; }
@media (max-width: 720px) {
  .plan-choice { grid-template-columns: 1fr; }
  .plan-card { min-height: 0; }
  .plan-price b { font-size: 56px; }
}
.alias { font-size: 18px; font-weight: 750; letter-spacing: -0.03em; margin: 2px 0 0; word-break: break-word; }
.pay-sheet .logo { border-radius: 999px; }
.pay-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.pay-kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.pay-amount { margin: 2px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.pay-amount span { font-size: 22px; font-weight: 650; }
.pay-alias { border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 12px; background: #fff; }
.pay-alias-top { display: flex; align-items: center; gap: 10px; }
.pay-alias-text { min-width: 0; flex: 1; }
.pay-alias-label { margin: 0; color: var(--muted); font-size: 13px; }
.pay-badge { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; flex: none; }
.pay-badge.ars { background: #e7f5ef; color: var(--green); }
.pay-badge.usd { background: #f8efd4; color: #8a6a1d; }
.pay-copy { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; flex: none; }
.pay-copy svg { width: 18px; height: 18px; }
.pay-alias .btn { margin-top: 10px; background: #fff; }
.pay-note, .pay-trial { display: flex; gap: 8px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 14px; line-height: 1.45; }
.pay-note { background: transparent; padding-left: 0; }
.pay-mark { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.pay-important {
  display: block;
  background: #f6f1e6;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.6;
}
.pay-important b { font-weight: 800; }
.pay-trial { background: #fff6dd; }
.pay-clock { width: 18px; height: 18px; flex: none; color: #8a6a1d; margin-top: 1px; }
.pay-clock svg { width: 18px; height: 18px; display: block; }
.pay-file-title { font-weight: 800; margin: 16px 0 8px; }
.file-pick { display: inline-flex; align-items: center; }
.file-pick input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.file-pick span { display: inline-block; border: 1px solid var(--line); background: #f3f0ea; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.file-status { margin-top: 8px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: var(--green); color: white;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.pill-line { display: block; }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,0.12); color: white;
  display: grid; place-items: center;
}
.badge-ro {
  display: inline-block; margin-top: 2px;
  background: var(--gold); color: var(--gold-ink);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800;
}

.shell { min-height: calc(100vh - 64px); }
.sidebar { display: none; }
.content { padding: 18px 16px 28px; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; gap: 2px;
  background: rgba(255,252,247,0.96);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}
.bottom-nav button, .nav-btn {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 12px;
}
.bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 700; padding: 6px 2px;
}
.bottom-nav button[aria-current="page"], .nav-btn[aria-current="page"] {
  color: var(--green); background: var(--mint);
}
body.is-in { padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom)); }

.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin-bottom: 14px; }
.page-head h1 { font-size: 28px; }
.kicker { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.action {
  text-align: left; border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-height: 92px;
}
.action strong { display: block; font-size: 18px; margin-bottom: 4px; }
.action span { color: var(--muted); font-size: 13px; }
.action.primary { background: var(--green); color: white; border-color: transparent; }
.action.primary span { color: rgba(255,255,255,0.78); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat, .card, .hero {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat { padding: 12px; }
.stat span, .muted { color: var(--muted); }
.stat strong, .money { font-variant-numeric: tabular-nums; }
.stat strong { display: block; margin-top: 4px; font-size: 16px; }
.hero { padding: 18px 18px 16px; margin-bottom: 12px; }
.hero-num { margin: 0; font-size: clamp(34px, 8vw, 56px); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.code-big { margin: 0 0 8px; font-size: 34px; font-weight: 800; letter-spacing: 0.14em; }
.public-wrap { width: min(420px, 100%); margin: 0 auto; padding: 28px 16px 48px; }
.card { padding: 14px; margin: 12px 0; }
details.card > summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.card h2 { font-size: 18px; margin-bottom: 10px; }
.stack { display: grid; gap: 10px; }

.banner {
  background: var(--terra-soft); color: var(--terra);
  border-radius: 14px; padding: 12px 14px; font-weight: 700; margin: 10px 0;
}
.banner.ok { background: var(--mint); color: var(--green); }
.banner.trial { background: var(--gold); color: var(--gold-ink); }
.owner-notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--gold); color: var(--gold-ink);
  padding: 8px 16px; font-size: 14px; font-weight: 700;
}
.notice-upload { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.notice-upload input { max-width: 180px; font-size: 12px; font-weight: 500; }
.notice-upload button {
  border: 1px solid var(--gold-ink); background: transparent; color: var(--gold-ink);
  border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700;
}
.notice-x {
  margin-left: auto; border: 0; background: transparent; color: var(--gold-ink);
  width: 28px; height: 28px; border-radius: 999px; font-size: 18px; line-height: 1; font-weight: 700;
}
.notice-x:hover { background: rgba(0, 0, 0, .08); }
.shop-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.shop-tools .btn { width: auto; padding: 4px 10px; font-size: 13px; border-radius: 999px; }
.shop-tools .btn.danger { color: var(--terra); border-color: #f0d2c8; }
.fiscal-files { display: flex; flex-wrap: wrap; gap: 10px; }
.fiscal-files .field { flex: 1; min-width: 180px; }
.fiscal-files input { font-size: 13px; }
.fiscal-files .btn { width: auto; margin-top: 6px; }
.checklist { margin: 0; padding-left: 18px; }
.checklist li { margin: 6px 0; }

.list { display: grid; gap: 8px; }
.item, .result {
  width: 100%; text-align: left; border: 1px solid var(--line); background: white;
  border-radius: 14px; padding: 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.result.is-active, .item.is-active { outline: 2px solid var(--green); background: var(--mint); }
.item-main { min-width: 0; }
.item-main strong, .result strong { display: block; }
.item-main small, .result small, .hint { color: var(--muted); display: block; }
.hint { margin-top: 4px; font-size: 12px; }
.result-side { text-align: right; flex: none; }
.result-side b { display: block; font-variant-numeric: tabular-nums; }

.badge, .status {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 3px 8px; font-size: 12px; font-weight: 800;
}
.low, .warn { color: var(--gold-ink); }
.out { color: var(--terra); }
.in { color: var(--green-2); }
.debt { background: var(--terra-soft); color: var(--terra); }
.stale { color: var(--gold-ink); font-weight: 700; }
.st-recibido, .st-diagnostico, .st-presupuestado { background: var(--blue-soft); color: var(--blue); }
.st-en_reparacion, .st-esperando_repuesto { background: #fff3d8; color: var(--gold-ink); }
.st-listo { background: var(--mint); color: var(--green); }
.st-entregado, .st-cancelado { background: #eeeae3; color: #5e584f; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 8px 12px; font-weight: 700; color: var(--muted);
}
.chip[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }

.pattern-pad {
  position: relative; width: 180px; height: 180px; margin: 4px 0;
  display: grid; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(3, 60px);
  place-items: center; color: var(--green);
}
.pattern-pad svg { position: absolute; inset: 0; width: 180px; height: 180px; pointer-events: none; }
.pattern-dot {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line);
  background: white; z-index: 1; font-weight: 800; color: var(--green);
}
button.pattern-dot { padding: 0; }
.pattern-dot.is-on { background: var(--green); color: white; border-color: var(--green); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.label { font-size: 13px; font-weight: 750; color: #4f493f; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px;
  padding: 12px 14px; font-size: 16px;
}
textarea { min-height: 84px; resize: vertical; }
.search { margin-bottom: 8px; }

.seg { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 14px; margin-bottom: 12px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 10px 6px; font-weight: 750;
}
.seg button[aria-pressed="true"] { background: white; color: var(--green); }

.btn {
  border: 0; border-radius: 14px; padding: 12px 14px; font-weight: 750; background: var(--bg-2);
}
.btn-primary { background: var(--green); color: white; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: var(--terra); color: white; }
.btn-block { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row .btn { flex: 1; }

.sale-grid { display: grid; gap: 14px; }
.ticket { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.ticket-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button, .linkish {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: white; font-weight: 800;
}
.price-input { width: 112px; text-align: right; padding: 8px 10px; }
.sale-confirm { margin-top: 8px; }
.preview { font-size: 14px; }
.preview div { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
.phone { font-weight: 750; text-decoration: none; }

.modal-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(28, 25, 21, 0.46);
  display: grid; align-items: end; padding: 16px;
}
.modal {
  background: var(--paper); border-radius: 22px; padding: 16px;
  width: min(520px, 100%); margin: 0 auto 8px;
  max-height: min(86vh, 760px); overflow: auto;
}
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 70;
  background: var(--ink); color: white; border-radius: 999px;
  padding: 12px 16px; font-weight: 700; max-width: calc(100% - 32px);
}
body.is-in .toast { bottom: calc(var(--nav) + 12px + env(safe-area-inset-bottom)); }
.toast.err { background: var(--terra); }
.empty { color: var(--muted); margin: 8px 0; }
.movements { display: grid; gap: 8px; }
.move { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.move b { font-variant-numeric: tabular-nums; }
.bill-pair { display: grid; gap: 0 16px; }
.bill-line { border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin: 0 0 12px; background: #fff; }
.bill-line-top { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.bill-line-top .seg { flex: 1; margin: 0; }
.bill-remove { width: 36px; height: 36px; border: 0; border-radius: 12px; background: var(--bg-2); font-size: 20px; line-height: 1; flex: none; }
.bill-line-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bill-subtotal { margin: 0; min-height: 48px; display: flex; align-items: center; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.hint.imei-ok { display: inline-block; width: auto; margin-top: 0; padding: 4px 8px; border-radius: 999px; background: var(--mint); color: var(--green); font-weight: 750; }
@media (min-width: 720px) {
  .bill-pair { grid-template-columns: 1fr 1fr; }
  .bill-line-grid { grid-template-columns: 0.6fr 1fr 1fr 0.9fr; align-items: end; }
}
body.is-busy .btn-primary { opacity: 0.65; pointer-events: none; }

@media (min-width: 900px) {
  .bottom-nav { display: none; }
  body.is-in { padding-bottom: 0; }
  .shell { display: grid; grid-template-columns: 230px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 64px; height: calc(100vh - 64px);
    padding: 16px 12px; border-right: 1px solid var(--line);
  }
  .nav-btn { display: flex; width: 100%; text-align: left; padding: 12px 12px; font-weight: 750; }
  .content { padding: 28px 32px 64px; max-width: 1040px; }
  .sale-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .ticket { position: sticky; top: 84px; }
  .modal-back { align-items: center; }
  .actions { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .stat strong { font-size: 20px; }
}
