/* TissueArg · Autogestión de clientes (clientes.tissuearg.rukan.ar). Rukan - Orden y desarrollo a medida
   Pensado primero para celular (390 px), como la vista previa aprobada. Marca: azul #153E76, Montserrat y Manrope. */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --azul: #153e76;        /* azul TISSUEARG */
  --azul-osc: #0f2d57;
  --azul-suave: #e6eef8;
  --celeste-txt: #1d4f91; /* texto sobre azul suave: 7:1 */
  --bg: #e9eef4;
  --panel: #ffffff;
  --linea: #d7dfe9;
  --txt: #1b2230;
  --mute: #4c586a;        /* 6,9:1 sobre blanco */
  --ok: #1a6b42; --ok-suave: #e2f3e9;
  --warn: #8a5a00; --warn-suave: #fdf1d8;
  --bad: #a8322a; --bad-suave: #fbe7e5;
  --foco: #f2b705;
  --r: 14px;
  --f-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --barra: 68px;          /* alto de la barra inferior */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--f-body); font-size: 16px; line-height: 1.45; color: var(--txt); background: var(--bg); min-height: 100dvh;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--barra) + env(safe-area-inset-bottom)); }
body.suelta { padding-bottom: 0; }
.app { max-width: 520px; margin: 0 auto; }
a { color: var(--azul); }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; border-radius: 6px; }

/* ---------- encabezado azul ---------- */
.cab { background: var(--azul); color: #fff; padding: 20px 18px 18px; }
.cab .marca { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cab .eti { font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2; }
.cab .eti-sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.cab h1 { font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.25; margin-top: 16px; }
.cab .linea { font-size: 15px; opacity: .95; margin-top: 2px; }
.cab .salir { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; font: 600 14px var(--f-body);
  min-height: 44px; min-width: 44px; padding: 0 12px; cursor: pointer; }
.cab .volver { color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 0 -4px; padding: 0 4px; }

main.cuerpo { padding: 16px 14px 8px; display: grid; gap: 14px; }

/* ---------- tarjetas ---------- */
.card { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--r); padding: 18px 16px; }
.card h2 { font-family: var(--f-display); font-weight: 700; font-size: 17px; line-height: 1.3; }
.card p { color: var(--mute); font-size: 15px; margin-top: 4px; }
.card .fila-tit { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card.destacada { background: var(--azul); border-color: var(--azul); color: #fff; }
.card.destacada p { color: #fff; opacity: .95; }
.card .acciones { margin-top: 14px; display: grid; gap: 8px; }
.vacio { color: var(--mute); text-align: center; padding: 20px 8px; }

/* ---------- botones ---------- */
.btn, button.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 16px;
  border-radius: 10px; border: 2px solid var(--azul); background: var(--azul); color: #fff; font: 700 16px var(--f-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--azul-osc); border-color: var(--azul-osc); }
.btn.linea { background: #fff; color: var(--azul); }
.btn.linea:hover { background: var(--azul-suave); }
.btn.blanco { background: #fff; color: var(--azul); border-color: #fff; }
.btn.blanco:hover { background: var(--azul-suave); }
.btn.chico { width: auto; min-height: 44px; padding: 6px 14px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--azul); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; min-height: 0; }
.link-btn.toque { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- etiquetas de estado ---------- */
.tag { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--azul-suave); color: var(--celeste-txt); white-space: nowrap; }
.tag.ok { background: var(--ok-suave); color: var(--ok); }
.tag.bad { background: var(--bad-suave); color: var(--bad); }
.tag.warn { background: var(--warn-suave); color: var(--warn); }

/* ---------- formularios ---------- */
label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.ayuda { font-size: 14px; color: var(--mute); margin-top: 6px; }
input[type=text], input[type=search], input[type=password], input[type=tel], input:not([type]), input[type=number] {
  width: 100%; min-height: 48px; border: 1.5px solid #8b98ab; border-radius: 10px; padding: 10px 12px; font: 500 16px var(--f-body); color: var(--txt); background: #fff; }
input::placeholder { color: #6b7688; }
input:focus-visible { outline: 3px solid var(--foco); outline-offset: 1px; border-color: var(--azul); }
.campo + .campo, .ayuda + .campo { margin-top: 14px; }
.error { color: var(--bad); font-weight: 600; font-size: 15px; margin-top: 10px; }
.error:empty { display: none; }

/* ---------- barra inferior ---------- */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom); }
.barra ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 520px; margin: 0 auto; }
.barra a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: var(--barra);
  color: var(--mute); text-decoration: none; font-size: 13px; font-weight: 600; }
.barra a svg { width: 26px; height: 26px; padding: 3px; border-radius: 7px; background: #e3e8ef; stroke: #6b7688; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.barra a[aria-current="page"] { color: var(--azul); }
.barra a[aria-current="page"] svg { background: var(--azul); stroke: #fff; }

.firma { text-align: center; color: var(--mute); font-size: 13px; padding: 14px 0 18px; }

/* ---------- aviso flotante ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barra) + 84px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--txt); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 600; max-width: min(92vw, 480px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }

/* ---------- productos (pedir) ---------- */
.buscar { position: relative; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--linea); background: #fff; color: var(--txt);
  font: 600 15px var(--f-body); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); color: #fff; }
.prods { list-style: none; }
.prod { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.prod:last-child { border-bottom: 0; }
.ini { width: 44px; height: 44px; border-radius: 10px; background: var(--azul-suave); color: var(--celeste-txt); display: grid; place-items: center;
  font: 800 14px var(--f-display); }
.prod .nom { font-weight: 600; font-size: 15px; line-height: 1.3; }
.prod .precio { font-weight: 800; color: var(--azul); font-size: 15px; margin-top: 2px; }
.prod .consultar { font-size: 13px; color: var(--warn); font-weight: 600; }
.paso { display: flex; align-items: center; border: 1.5px solid var(--linea); border-radius: 10px; overflow: hidden; background: #fff; }
.paso button { width: 44px; height: 44px; border: 0; background: #fff; color: var(--azul); font: 800 22px var(--f-body); cursor: pointer; }
.paso button:hover { background: var(--azul-suave); }
.paso input { width: 46px; min-height: 44px; border: 0; border-radius: 0; text-align: center; font-weight: 800; padding: 0; -moz-appearance: textfield; }
.paso input::-webkit-outer-spin-button, .paso input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.total { position: sticky; bottom: calc(var(--barra) + env(safe-area-inset-bottom)); z-index: 10; background: var(--azul); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin: 0 -14px; }
.total b { font-family: var(--f-display); font-size: 17px; display: block; }
.total small { font-size: 13px; opacity: .95; }
.total .btn { width: auto; }

/* ---------- resumen (hoja) ---------- */
dialog.hoja { border: 0; padding: 0; width: 100%; max-width: 520px; margin: auto auto 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
dialog.hoja::backdrop { background: rgba(10, 20, 40, .55); }
.hoja .dentro { padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); }
.hoja h2 { font-family: var(--f-display); font-size: 19px; }
.res { list-style: none; margin: 14px 0; border-top: 1px solid var(--linea); }
.res li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linea); font-size: 15px; }
.res li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cuentas { display: grid; gap: 4px; font-size: 15px; }
.cuentas div { display: flex; justify-content: space-between; gap: 12px; }
.cuentas .grande { font-family: var(--f-display); font-weight: 800; font-size: 19px; color: var(--azul); margin-top: 6px; }

/* ---------- lo que tengo ---------- */
.tabla-tengo { width: 100%; border-collapse: collapse; margin-top: 10px; }
.tabla-tengo th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); text-align: left; padding: 8px 0; border-bottom: 1px solid var(--linea); }
.tabla-tengo th.n { text-align: center; width: 72px; }
.tabla-tengo td { padding: 12px 0; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla-tengo tr:last-child td { border-bottom: 0; }
.tabla-tengo td.n { text-align: center; padding-left: 8px; }
.tabla-tengo .nom { font-weight: 600; font-size: 15px; line-height: 1.3; }
.tabla-tengo .cons { font-size: 14px; color: var(--mute); }
.tabla-tengo input { width: 64px; min-height: 44px; text-align: center; font-weight: 700; padding: 6px; }
.falta { display: inline-grid; place-items: center; min-width: 64px; min-height: 44px; border-radius: 10px; background: var(--azul-suave); color: var(--celeste-txt); font-weight: 800; }
.falta.cero, .falta.nada { background: #eef1f5; color: var(--mute); font-weight: 600; }
.corregir { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.corregir input { width: 90px; }

/* ---------- estado del pedido ---------- */
.tiempo { list-style: none; margin-top: 14px; }
.tiempo li { position: relative; padding: 0 0 18px 34px; }
.tiempo li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--linea); }
.tiempo li:last-child::before { display: none; }
.tiempo li.hecho::before { background: var(--ok); }
.tiempo .punto { position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #9aa6b6; background: #fff; display: grid; place-items: center; }
.tiempo li.hecho .punto { border-color: var(--ok); background: var(--ok); }
.tiempo li.hecho .punto::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.tiempo li.actual .punto { border-color: var(--azul); background: #fff; }
.tiempo li.actual .punto::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--azul); }
.tiempo .nom { font-weight: 600; }
.tiempo li.actual .nom { color: var(--azul); font-weight: 800; }
.tiempo li.pendiente .nom { color: var(--mute); font-weight: 500; }
.tiempo small { display: block; color: var(--mute); font-size: 14px; }
details.det summary { cursor: pointer; font-weight: 700; color: var(--azul); min-height: 44px; display: flex; align-items: center; }
.lista-ped { list-style: none; display: grid; gap: 12px; }
.lista-ped a { text-decoration: none; color: inherit; display: block; }
.lista-ped a:hover .card { border-color: var(--azul); }

/* página suelta (no encontrada) */
.caja-suelta { max-width: 420px; margin: 80px auto 0; padding: 0 18px; display: grid; gap: 14px; }
.caja-suelta h1 { font-family: var(--f-display); color: var(--azul); }

@media (min-width: 560px) {
  body { background: var(--bg); }
  .app { box-shadow: 0 0 0 1px var(--linea); min-height: 100dvh; background: var(--bg); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
