:root {
  /* ===== Marca MI VECINO: verde profundo + dorado (azul agua para acentos) ===== */
  --green: #0E4D38;
  --green-2: #176B4D;
  --green-deep: #0A3527;
  --green-soft: #DCEBE2;
  --gold: #C9A227;
  --gold-soft: #FAF1D4;
  --blue: #1668B0;
  --blue-soft: #E5F0FA;
  --red: #A62834;
  --red-soft: #F6D7DA;
  --amber: #8A6D00;
  --amber-soft: #FBEFC8;
  --bg: #F6F4EE;
  --card: #FFFFFF;
  --ink: #192620;
  --muted: #5E6E66;
  --line: #E5E1D6;
  --shadow: 0 1px 2px rgba(10,53,39,.06), 0 4px 14px rgba(10,53,39,.10);
  --radius: 14px;
  --font-brand: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-brand); margin: 0; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.oculto { display: none !important; }
.muted { color: var(--muted); }
.rojo { color: var(--red); }
.verde { color: var(--green-2); }
.azul { color: var(--blue); }
.b { font-weight: 700; }
.der { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }

/* ===== Cabecera y navegacion ===== */
.top { position: sticky; top: 0; z-index: 20; background: var(--green); color: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.top .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: var(--green-deep); font-family: var(--font-brand); font-weight: 800; display: grid; place-items: center; font-size: 15px; flex: none; }
.top .tit { font-family: var(--font-brand); font-weight: 700; font-size: 15px; line-height: 1.1; }
.top .sub { font-size: 12px; opacity: .85; }
.top .tasa { margin-left: auto; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.top .tasa.sin { background: var(--red); border-color: var(--red); }
.nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h); background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.nav button .ic { font-size: 22px; line-height: 1; }
.nav button.on { color: var(--green); }
.pag { padding: 14px 14px calc(var(--nav-h) + 20px); max-width: 980px; margin: 0 auto; }
@media (min-width: 900px) {
  .nav { position: sticky; top: 54px; bottom: auto; height: 46px; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  .nav button { flex: 0 0 130px; flex-direction: row; gap: 8px; font-size: 14px; }
  .nav button .ic { font-size: 18px; }
  .pag { padding-bottom: 30px; }
}

/* ===== Tarjetas, botones, formularios ===== */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .esp { flex: 1; }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; background: var(--green); color: #fff; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sec { background: var(--green-soft); color: var(--green); }
.btn.gold { background: var(--gold); color: var(--green-deep); }
.btn.rojo { background: var(--red-soft); color: var(--red); }
.btn.lin { background: none; color: var(--green); border: 1.5px solid var(--line); }
.btn.chico { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn.ancho { width: 100%; }
.btn.grande { padding: 16px; font-size: 18px; }
.fila { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fila > .esp { flex: 1; }
.campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.campo label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.campo input, .campo select, .campo textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; font-size: 16px; width: 100%; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px var(--green-soft); }
.campo .ayuda { font-size: 12px; color: var(--muted); }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .g3 { grid-template-columns: 1fr 1fr; } }
.seg { display: flex; background: var(--bg); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; border-radius: 9px; padding: 9px 6px; background: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--green); box-shadow: var(--shadow); }
.chip { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: var(--green-soft); color: var(--green); }
.chip.gold { background: var(--gold-soft); color: var(--amber); }
.chip.azul { background: var(--blue-soft); color: var(--blue); }
.chip.rojo { background: var(--red-soft); color: var(--red); }
.chip.gris { background: var(--line); color: var(--muted); }
.aviso { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.aviso.rojo { background: var(--red-soft); color: var(--red); }
.vacio { text-align: center; color: var(--muted); padding: 24px 10px; }
.lista { display: flex; flex-direction: column; }
.item { display: flex; gap: 10px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .cuerpo { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { font-size: 13px; color: var(--muted); }
.item .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .num .bs { font-weight: 700; }
.item .num .usd { font-size: 12px; color: var(--muted); }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.tb td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tb tr:last-child td { border-bottom: 0; }
table.tb td.n, table.tb th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tb tr.tot td { font-weight: 800; border-top: 2px solid var(--green); }

/* ===== Login ===== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; }
.login .marca { text-align: center; margin-bottom: 18px; }
.login .marca .logo { width: 64px; height: 64px; border-radius: 18px; background: var(--gold); color: var(--green-deep); font-family: var(--font-brand); font-weight: 800; font-size: 26px; display: grid; place-items: center; margin: 0 auto 10px; }
.login .marca h1 { font-size: 20px; color: var(--green); }

/* ===== Vender ===== */
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.prod { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; text-align: left; display: flex; flex-direction: column; gap: 4px; position: relative; min-height: 86px; }
.prod.agua { border-left: 5px solid var(--blue); }
.prod.envase { border-left: 5px solid var(--green-2); }
.prod.hielo { border-left: 5px solid #7FB8E8; }
.prod.otro { border-left: 5px solid var(--gold); }
.prod.litro { border-left: 5px solid #37A0C9; background: #F4FAFD; }
.prod .n { font-weight: 700; font-size: 14px; line-height: 1.2; }
.prod .p { font-size: 13px; color: var(--muted); }
.prod .p b { color: var(--ink); font-size: 15px; }
.prod .cant { position: absolute; top: 6px; right: 6px; background: var(--green); color: #fff; border-radius: 999px; min-width: 26px; height: 26px; display: grid; place-items: center; font-weight: 800; font-size: 14px; padding: 0 7px; }
.prod.en { border-color: var(--green-2); background: #F3FAF6; }
.carrito .lin { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.carrito .lin:last-child { border-bottom: 0; }
.carrito .lin .n { font-weight: 600; font-size: 14px; }
.carrito .lin .pu { font-size: 12px; color: var(--muted); }
.carrito .lin .pu input { width: 74px; border: 1px dashed var(--line); border-radius: 7px; padding: 3px 5px; font-size: 13px; text-align: right; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: var(--bg); font-size: 20px; font-weight: 700; color: var(--green); }
.stepper input { width: 46px; height: 36px; border: 0; text-align: center; font-weight: 700; font-size: 16px; }
.tot-box { background: var(--green-deep); color: #fff; border-radius: var(--radius); padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; }
.tot-box .l { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.tot-box .bs { font-family: var(--font-brand); font-size: 28px; font-weight: 800; line-height: 1; }
.tot-box .usd { font-size: 15px; color: var(--gold); font-weight: 700; }
.pagos .pl { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 6px 0; font-size: 14px; }
.saldo { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; font-weight: 700; margin: 8px 0; }
.saldo.falta { background: var(--amber-soft); color: var(--amber); }
.saldo.vuelto { background: var(--blue-soft); color: var(--blue); }
.saldo.ok { background: var(--green-soft); color: var(--green); }
.cliente-sel { display: flex; align-items: center; gap: 8px; background: var(--blue-soft); border-radius: 10px; padding: 8px 10px; }
.cliente-sel .n { font-weight: 700; flex: 1; }
.sugs { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 10; max-height: 220px; overflow: auto; }
.sugs div { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sugs div:hover { background: var(--bg); }
.rel { position: relative; }

/* ===== Cierre ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.kpi .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-family: var(--font-brand); font-size: 22px; font-weight: 800; color: var(--green); margin-top: 3px; }
.kpi .v2 { font-size: 13px; color: var(--muted); }
.kpi.gold .v { color: var(--amber); }
.kpi.rojo .v { color: var(--red); }
.kpi.azul .v { color: var(--blue); }

/* ===== Modal / toast ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(10,53,39,.55); z-index: 50; display: grid; place-items: end center; padding: 0; }
.modal { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 700px) { .modal-bg { place-items: center; padding: 20px; } .modal { border-radius: 18px; } }
.modal h2 { font-size: 18px; margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 92vw; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--red); }
.ticket { font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 12px; }
