/* Camisetas Perros — sistema visual (rediseño handoff Claude Design).
   Mobile-first; la app vive en una columna tipo celular centrada en desktop. */

:root {
  --navy: #0b2a63;
  --navy-2: #0e3275;
  --azul-txt: #aecbff;
  --amarillo: #ffd400;
  --rojo: #e4002b;
  --verde: #1faa55;
  --crema: #f5f3ec;
  --tinta: #16203a;
  --tinta-2: #1c2230;
  --gris-txt: #6b7488;
  --gris-2: #8089a0;
  --gris-3: #9aa1b0;
  --campo-bg: #f4f5f8;
  --campo-bd: #e7e9ef;
  /* Tipografía: una sola familia para todo el proyecto (cambiar aquí para probar otra). */
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--tinta);
  background: #0a1f47;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; }
input:focus, textarea:focus, select:focus { outline: none; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
a { color: inherit; }
::-webkit-scrollbar { width: 0; height: 0; }
.cond { font-family: var(--font-display); }

#app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--crema);
  position: relative;
  overflow-x: hidden;
}

.screen { display: flex; flex-direction: column; min-height: 100dvh; background: var(--crema); }

/* ---------- Encabezados ---------- */
.apphead {
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 18px 16px;
}
.apphead--flat { background: var(--navy); }
.apphead--red { background: linear-gradient(180deg, #6a1018, #8a1422); }
.apphead__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.apphead__hi { font-size: 13px; color: var(--azul-txt); font-weight: 500; }
.apphead--red .apphead__hi { color: #ffc9cf; }
.apptitle { font-family: var(--font-display); font-weight: 700; font-size: 26px; text-transform: uppercase; line-height: 1; }
.apphead__sub { margin-top: 6px; font-size: 13px; color: #ffd9dd; font-weight: 500; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center;
}
.iconbtn--initials { font-family: var(--font-display); font-weight: 700; color: var(--amarillo); font-size: 18px; }
.iconbtn--wa { background: var(--verde); }
.backbtn { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-salir { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.btn-salir:hover { background: rgba(255,255,255,.22); }

/* ---------- Buscador ---------- */
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border-radius: 14px; padding: 0 14px; height: 46px; margin-top: 14px;
}
.search input { flex: 1; min-width: 0; background: none; border: none; color: #fff; font-size: 15px; font-weight: 500; }
.search input::placeholder { color: var(--azul-txt); }

/* ---------- Chips de filtro ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 18px; background: var(--navy-2); }
.chip {
  flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; border-radius: 999px; min-height: 40px;
  font-weight: 700; font-size: 13px; border: 1.5px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08); color: #cfe0ff;
}
.chip.is-active { border-color: var(--amarillo); background: var(--amarillo); color: var(--navy); }
.chip .count { opacity: .7; margin-left: 5px; }

/* ---------- Listas / contenedores ---------- */
.list { flex: 1; padding: 14px 14px 120px; display: flex; flex-direction: column; gap: 12px; }
.list--cream { background: var(--crema); }
.vacio { text-align: center; color: var(--gris-3); padding: 50px 20px; font-weight: 500; }

/* ---------- Tarjeta de pedido (tablero) ---------- */
.ocard {
  position: relative; text-align: left; width: 100%; background: #fff; border-radius: 18px;
  padding: 14px 16px 14px 20px; box-shadow: 0 2px 0 rgba(11,42,99,.04), 0 8px 22px -14px rgba(11,42,99,.28);
  overflow: hidden; display: flex; flex-direction: column; gap: 12px; cursor: pointer;
}
.ocard__spine { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; }
.ocard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ocard__id { display: flex; align-items: center; gap: 8px; min-width: 0; }
.code {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--navy);
  background: #eef2fb; padding: 3px 8px; border-radius: 7px; letter-spacing: .02em; white-space: nowrap;
}
.cliente { font-weight: 700; font-size: 15px; color: var(--tinta-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-btn { width: 40px; height: 40px; border-radius: 11px; background: #e8f8ee; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.shirts { display: flex; flex-direction: column; gap: 7px; }
.shirt-line { display: flex; align-items: center; gap: 10px; }
.talla {
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: #fff;
  background: var(--navy); min-width: 34px; text-align: center; padding: 4px 6px; border-radius: 8px;
}
.perro { flex: 1; font-weight: 700; font-size: 17px; color: var(--tinta); line-height: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dorsal { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: .8; color: var(--rojo); }
.more { font-size: 13px; font-weight: 600; color: var(--gris-txt); }

.ocard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #f0f0ea; padding-top: 11px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 999px; }
.pill__dot { width: 7px; height: 7px; border-radius: 50%; }
.pay { font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 999px; }
.pay--due { color: var(--rojo); background: #fde8ea; }
.pay--ok { color: #15803d; background: #dcfce7; font-weight: 700; }
.aviso-editado { font-size: 12px; color: var(--rojo); font-weight: 700; }

/* ---------- Nav inferior ---------- */
.botnav {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 460px; height: 78px;
  background: #fff; border-top: 1px solid #ececec; display: flex; align-items: stretch;
  padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px -18px rgba(0,0,0,.3); z-index: 30;
}
.botnav a, .botnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; position: relative; }
.botnav__lbl { font-size: 11px; font-weight: 700; }
.botnav .fab { flex: 0 0 64px; margin-top: -22px; }
.fab__plus { width: 60px; height: 60px; border-radius: 20px; background: var(--amarillo); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 22px -8px rgba(255,212,0,.7); }
.fab__lbl { display: none; }
.naviconwrap { position: relative; display: inline-flex; }
.navbadge {
  position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.navbadge[hidden] { display: none; }

/* ---------- Formulario (nuevo / editar) ---------- */
.form { flex: 1; padding: 16px 16px 170px; display: flex; flex-direction: column; gap: 16px; }
.formcard { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 8px 22px -16px rgba(11,42,99,.3); display: flex; flex-direction: column; gap: 12px; animation: cp-pop .2s ease; }
.formcard__head { display: flex; align-items: center; justify-content: space-between; }
.formcard__title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
.field { height: 50px; width: 100%; border-radius: 12px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); padding: 0 14px; font-size: 16px; font-weight: 600; color: var(--tinta); }
.lbl-mini { font-size: 12px; font-weight: 700; color: var(--gris-2); text-transform: uppercase; letter-spacing: .06em; }
.tallagrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tallabtn { height: 46px; border-radius: 11px; font-family: var(--font-display); font-weight: 700; font-size: 16px; border: 1.5px solid var(--campo-bd); background: var(--campo-bg); color: #5a6275; }
.tallabtn.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.shirt-row { display: flex; gap: 10px; }
.shirt-row .col { display: flex; flex-direction: column; gap: 6px; }
.shirt-row .col-nombre { flex: 1; }
.shirt-row .col-num { width: 96px; }
.field--num { padding: 0 12px; font-family: var(--font-display); font-weight: 700; font-size: 24px; text-align: center; color: var(--tinta); }
.field--dir { height: auto; min-height: 104px; padding: 12px 14px; line-height: 1.4; resize: vertical; font-weight: 500; }
.draft-banner { display: flex; align-items: center; gap: 10px; background: #fff7d6; border: 1.5px solid #f0d97a; border-radius: 12px; padding: 11px 14px; font-size: 13px; font-weight: 600; color: #7a5b00; }
.draft-banner button { margin-left: auto; flex-shrink: 0; background: var(--navy); color: #fff; border-radius: 8px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
#shirts { display: flex; flex-direction: column; gap: 16px; }
.formcard__title--cam { color: var(--rojo); }
.pago-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pago-fila--saldo { border-top: 1px dashed var(--campo-bd); padding-top: 12px; margin-top: 2px; }
.saldo-lbl { font-weight: 700; color: var(--tinta); font-size: 16px; }
.saldo-monto { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--rojo); }
.abono-box-wrap { display: flex; flex-direction: column; gap: 12px; }
.check-abono { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--tinta); font-size: 15px; padding: 4px 0; }
.check-abono input { width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; }
.pagado-full { display: flex; align-items: center; gap: 6px; color: #15803d; font-weight: 700; font-size: 14px; }
.banco-select { height: 48px; width: 170px; max-width: 60%; border-radius: 12px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); padding: 0 10px; font-size: 15px; font-weight: 600; color: var(--tinta); font-family: inherit; }
.linkquitar { font-size: 13px; font-weight: 700; color: var(--rojo); padding: 8px 12px; min-height: 40px; }
.price-hint { font-size: 13px; font-weight: 600; color: var(--gris-txt); text-align: right; }
.addshirt { border: 2px dashed #c3cbe0; border-radius: 16px; height: 54px; color: var(--navy); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; width: 100%; }
.abono-box { display: flex; align-items: center; justify-content: space-between; }
.abono-input { display: flex; align-items: center; gap: 4px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); border-radius: 12px; padding: 0 12px; height: 48px; width: 170px; }
.abono-input span { font-weight: 700; color: var(--navy); font-size: 18px; flex-shrink: 0; }
.abono-input input { flex: 1; min-width: 0; width: auto; background: none; border: none; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--navy); text-align: right; }
.field-label { font-weight: 600; color: var(--gris-txt); font-size: 15px; }
.errores { color: var(--rojo); font-size: 13px; font-weight: 600; padding: 0 4px; }

/* ---------- Barra fija de guardado (formulario) ---------- */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 460px; background: #fff;
  border-top: 1px solid #ececec; padding: 12px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px -16px rgba(0,0,0,.2); z-index: 30;
}
.savebar__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.totals { display: flex; gap: 18px; }
.totals .k { font-size: 11px; font-weight: 700; color: var(--gris-3); text-transform: uppercase; }
.bigmoney { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--tinta); line-height: 1; }
.bigmoney--input { width: 92px; border: none; background: none; padding: 0; }
.savebar__note { font-size: 12px; color: var(--gris-3); font-weight: 600; text-align: right; max-width: 110px; }

/* ---------- Botones de acción ---------- */
.btn-amar { width: 100%; height: 56px; border-radius: 16px; background: var(--amarillo); color: var(--navy); font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 12px 24px -8px rgba(255,212,0,.5); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-verde { width: 100%; height: 56px; border-radius: 16px; background: var(--verde); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 12px 24px -10px rgba(31,170,85,.6); }
.btn-navy { width: 100%; height: 50px; border-radius: 14px; background: var(--navy); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-verde-sm { height: 50px; border-radius: 14px; background: var(--verde); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn-ghost { height: 50px; border-radius: 14px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); color: var(--navy); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
button[disabled] { opacity: .7; cursor: default; }

/* ---------- Login ---------- */
.login { position: relative; min-height: 100dvh; background: radial-gradient(120% 80% at 50% 0%, #1a4ba0 0%, #0b2a63 60%, #08203f 100%); display: flex; flex-direction: column; }
.login__body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 32px; text-align: center; }
.login__logo { width: 96px; height: 96px; border-radius: 28px; background: var(--amarillo); display: flex; align-items: center; justify-content: center; box-shadow: 0 16px 30px -10px rgba(255,212,0,.5); margin-bottom: 22px; }
.login__title { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: .95; color: #fff; text-transform: uppercase; }
.login__tag { margin-top: 10px; color: var(--azul-txt); font-weight: 500; font-size: 14px; }
.login__form { width: 100%; margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.login__q { text-align: left; color: #9fc0f5; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding-left: 4px; }
.usergrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.userbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; }
.userbtn.is-active { border-color: var(--amarillo); background: rgba(255,212,0,.16); }
.userbtn b { font-weight: 700; font-size: 16px; }
.userbtn span { font-size: 12px; opacity: .8; font-weight: 500; }
.login-pass { width: 100%; height: 54px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.18); color: #fff; font-size: 16px; padding: 0 16px; font-weight: 600; margin-top: 8px; }
.login-pass::placeholder { color: rgba(255,255,255,.55); }
.login__err { color: #ffd9dd; font-size: 13px; font-weight: 600; min-height: 18px; }
.login__foot { text-align: center; color: #6f8fc8; font-size: 11px; padding-bottom: 26px; }

/* ---------- Detalle: pipeline + tarjetas ---------- */
.detcard { background: #fff; border-radius: 18px; padding: 16px; box-shadow: 0 8px 22px -16px rgba(11,42,99,.3); display: flex; flex-direction: column; gap: 10px; }
.detcard__title { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--navy); text-transform: uppercase; }
.step { display: flex; align-items: stretch; gap: 12px; }
.step__col { display: flex; flex-direction: column; align-items: center; }
.step__dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; color: #fff; }
.step__line { width: 2px; flex: 1; min-height: 14px; }
.step__label { font-size: 15px; padding: 2px 0 16px; line-height: 1.1; }
.kv { display: flex; justify-content: space-between; }
.kv .k { color: var(--gris-txt); font-weight: 600; }
.kv .v { font-weight: 700; color: var(--tinta); }
.kv--total { border-top: 1px dashed var(--campo-bd); padding-top: 10px; }
.saldo-big { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; }
.det-shirt { display: flex; align-items: center; gap: 12px; background: #f7f8fb; border-radius: 12px; padding: 12px; }
.det-shirt .talla { font-size: 17px; min-width: 44px; padding: 7px; border-radius: 9px; }
.det-shirt .perro { font-size: 19px; }
.det-shirt .dorsal { font-size: 36px; }
.envio-input { display: flex; gap: 8px; align-items: center; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); border-radius: 12px; padding: 0 12px; height: 48px; }
.envio-input input { flex: 1; min-width: 0; background: none; border: none; font-size: 15px; font-weight: 600; color: var(--tinta); }
.det-meta { font-size: 12px; color: var(--gris-3); text-align: center; font-weight: 500; line-height: 1.6; }
.paid-flag { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--verde); font-weight: 700; }

/* ---------- Cola de producción ---------- */
.qcard { background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: 0 8px 22px -16px rgba(11,42,99,.3); display: flex; flex-direction: column; gap: 12px; }
.qcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qshirt { display: flex; align-items: center; gap: 12px; background: #f7f8fb; border-radius: 12px; padding: 10px 12px; }
.qshirt .talla { font-size: 16px; min-width: 40px; padding: 6px; border-radius: 9px; }
.qshirt .perro { font-size: 19px; }
.qshirt .dorsal { font-size: 34px; }
.taken { font-size: 13px; font-weight: 600; color: var(--gris-2); display: flex; align-items: center; gap: 6px; }
.taken__dot { width: 8px; height: 8px; border-radius: 50%; }
.qbtn { height: 52px; border-radius: 14px; font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }

/* ---------- Dashboard / Resumen ---------- */
.rowtwo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.statbig { background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: 0 8px 22px -16px rgba(11,42,99,.3); }
.statbig__k { font-size: 12px; font-weight: 700; color: var(--gris-3); text-transform: uppercase; letter-spacing: .04em; }
.statbig__v { font-family: var(--font-display); font-weight: 700; font-size: 38px; line-height: 1; color: var(--tinta); margin-top: 2px; }
.statbig__v small { font-size: 15px; color: var(--gris-3); font-weight: 600; }
.prodgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prodstat { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f7f8fb; border-radius: 12px; padding: 11px 12px; width: 100%; text-align: left; border: none; min-height: 52px; }
.prodstat__l { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--tinta); }
.prodstat__n { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; }
.bar { height: 10px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; }
.barlbl { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--gris-txt); }
.linkcobrar { font-size: 13px; font-weight: 700; color: var(--rojo); background: none; padding: 6px 0; text-align: left; }
.ritmo { display: flex; gap: 24px; }
.ritmo .k { font-size: 12px; font-weight: 700; color: var(--gris-3); text-transform: uppercase; }
.ritmo .v { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--tinta); }
.fecha-mini { font-size: 12px; font-weight: 700; color: var(--gris-3); white-space: nowrap; flex-shrink: 0; }
.fechas-rango { display: flex; gap: 10px; }
.campo-fecha { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; color: var(--gris-2); text-transform: uppercase; letter-spacing: .04em; }
.campo-fecha input { height: 44px; border-radius: 12px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); padding: 0 10px; font-size: 15px; font-weight: 600; color: var(--tinta); font-family: inherit; }
.quickchips { display: flex; gap: 8px; }
.qchip { flex: 1; min-width: 0; padding: 9px 4px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); color: var(--navy); }
.datetoggle { display: flex; align-items: center; gap: 8px; margin: 12px 14px 0; padding: 11px 14px; border-radius: 12px; background: #fff; border: 1.5px solid var(--campo-bd); font-weight: 700; font-size: 14px; color: var(--navy); }
.datetoggle__chev { margin-left: auto; color: var(--gris-2); font-size: 12px; transition: transform .15s; }
.datetoggle.is-open .datetoggle__chev { transform: rotate(180deg); }
.datetoggle.is-active { border-color: var(--navy); background: #eef2fb; }
.datepanel { margin: 8px 14px 0; padding: 14px; background: #fff; border: 1.5px solid var(--campo-bd); border-radius: 14px; display: flex; flex-direction: column; gap: 12px; }
.datepanel[hidden] { display: none; }
.ventas-nums { display: flex; justify-content: space-between; gap: 10px; }
.ventas-nums .k { font-size: 12px; font-weight: 700; color: var(--gris-3); text-transform: uppercase; }
.ventas-nums .v { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; color: var(--tinta); }
.stockhead { display: flex; align-items: center; justify-content: space-between; }
.stock-edit { font-size: 13px; font-weight: 700; color: var(--navy); background: var(--campo-bg); border: 1.5px solid var(--campo-bd); border-radius: 10px; padding: 7px 12px; }
.stockrow { display: grid; grid-template-columns: 46px 1fr 1fr 1fr; gap: 8px; align-items: center; }
.stockrow--h .sc-h { font-size: 11px; font-weight: 700; color: var(--gris-3); text-transform: uppercase; text-align: center; }
.stock-cell { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--tinta); }
.stock-cell.muted { color: var(--gris-2); font-weight: 700; }
.stock-input { width: 100%; height: 40px; border-radius: 10px; background: var(--campo-bg); border: 1.5px solid var(--campo-bd); text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--tinta); }
/* Stock simplificado: una sola columna editable a mano (talla · cantidad) */
.stockrow--simple { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--campo-bd); }
.stockrow--simple:last-child { border-bottom: none; }
.stockrow--simple .stock-cell { font-size: 22px; min-width: 56px; text-align: right; }
.stockrow--simple .stock-input { width: 96px; }
.stock-nota { font-size: 12.5px; color: var(--gris-2); font-weight: 500; line-height: 1.35; margin: -2px 0 4px; }

/* ---------- Carga / error ---------- */
.estado-carga { padding: 60px 24px; text-align: center; color: var(--gris-3); font-weight: 600; }
.error-box { margin: 24px 16px; background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 8px 22px -16px rgba(11,42,99,.3); }
.error-box p { margin: 4px 0; }
.error-box .hint { color: var(--gris-3); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--tinta); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700;
  font-size: 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.5); z-index: 50; white-space: nowrap; max-width: 90vw;
  opacity: 0; transition: opacity .22s ease, transform .22s ease; pointer-events: none;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); flex-shrink: 0; }
.toast.error::before { background: var(--rojo); }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes cp-pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Impresión de orden (oculto en pantalla; visible solo al imprimir) ---------- */
.print-ticket { display: none; }
.pt-top { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 12px; }
.pt-brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.pt-code { font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.pt-cam { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.pt-cam th { text-align: left; font-size: 11px; text-transform: uppercase; border-bottom: 1.5px solid #000; padding: 4px 6px; letter-spacing: .04em; }
.pt-cam td { padding: 9px 6px; border-bottom: 1px solid #ccc; font-size: 17px; }
.pt-talla { font-family: var(--font-display); font-weight: 700; }
.pt-num { font-family: var(--font-display); font-weight: 700; font-size: 30px; text-align: right; }
.pt-block { margin-bottom: 10px; font-size: 14px; line-height: 1.7; }
.pt-foot { margin-top: 16px; font-size: 11px; color: #444; }
@media print {
  body { background: #fff; }
  body * { visibility: hidden !important; }
  .print-ticket, .print-ticket * { visibility: visible !important; }
  .print-ticket { display: block !important; position: absolute; left: 0; top: 0; width: 100%; padding: 8mm; color: #000; font-family: var(--font-body); }
}

/* ---------- Escritorio: navegación arriba, contenido en columnas ---------- */
@media (min-width: 880px) {
  #app { max-width: 1280px; display: flex; flex-direction: column; box-shadow: 0 0 80px -30px rgba(0,0,0,.55); }
  .screen { min-height: 0; }

  /* La nav inferior pasa a barra superior */
  .botnav {
    order: -1; position: sticky; top: 0; z-index: 40;
    width: 100%; max-width: none; height: auto; margin: 0;
    flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px;
    padding: 10px 24px; border-top: none; border-bottom: 1px solid #ececec;
    box-shadow: 0 2px 16px -10px rgba(0,0,0,.3);
  }
  .botnav a, .botnav button { flex: 0 0 auto; flex-direction: row; gap: 9px; padding: 9px 16px; border-radius: 10px; min-height: 0; }
  .botnav a:hover { background: var(--crema); }
  .botnav__lbl { font-size: 14px; }
  .botnav .fab { order: 99; margin-left: auto; margin-top: 0; }
  .botnav .fab .fab__plus { width: 38px; height: 38px; border-radius: 11px; }
  .botnav .fab .fab__lbl { display: inline; font-size: 14px; color: var(--navy); }
  .navbadge { top: -4px; right: -8px; }

  /* Más aire en encabezados y contenido */
  .apphead { padding: 22px 28px 16px; }
  .apphead--flat, .apphead--red { padding: 22px 28px; }
  .search { max-width: 520px; }
  .chips { padding: 14px 28px; }
  .datetoggle { margin: 14px 28px 0; max-width: 520px; }
  .datepanel { margin: 8px 28px 0; max-width: 520px; }
  .list { padding: 22px 28px 48px; }

  /* Pedidos y cola: grilla de tarjetas */
  .list--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
  .list--grid .vacio { grid-column: 1 / -1; }

  /* Dashboard: dos columnas (los dos números grandes ocupan todo el ancho arriba) */
  .list--dash { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .list--dash .rowtwo { grid-column: 1 / -1; }

  /* Detalle: columna centrada cómoda */
  .list--narrow { max-width: 660px; margin: 0 auto; width: 100%; }

  /* Formularios centrados; la barra de guardar deja de ser fija */
  .form { max-width: 600px; margin: 0 auto; padding: 24px 0 40px; width: 100%; }
  .savebar { position: static; max-width: 600px; margin: 10px auto 0; box-shadow: none; border-top: 1px solid #ececec; padding: 18px 0 8px; }

  /* Login centrado */
  .login__body { max-width: 440px; margin: 0 auto; }
}
