/* ═══════════════════════════════════════════════════════
   IVOLUTION · COTIZADOR — editor.css
═══════════════════════════════════════════════════════ */
:root {
  --gold: #D8A13F;
  --gold-soft: #F6ECD8;
  --ink: #111;
  --ink-2: #4A4A4A;
  --ink-3: #8A8A8A;
  --line: #E4E1DA;
  --bg: #F3F2EF;
  --card: #fff;
  --red: #E94F37;
  --font: 'Roboto', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h2 { margin: 0 0 14px; font: italic 900 16px var(--font); text-transform: uppercase; letter-spacing: .01em; }
h2::before { content: ''; display: inline-block; width: 9px; height: 15px; margin-right: 8px; background: var(--gold); transform: skewX(-18deg); vertical-align: -2px; }
.hint { margin: -6px 0 12px; color: var(--ink-3); font-size: 13px; }

/* ── barra ── */
.bar { position: sticky; top: 0; z-index: 20; height: 58px; background: #000; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.bar-l { display: flex; align-items: center; gap: 12px; }
.bar-logo { height: 20px; }
.bar-tag { color: var(--gold); font: italic 700 12px var(--font); text-transform: uppercase; letter-spacing: .14em; padding-left: 12px; border-left: 1px solid #333; }

/* ── botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1.5px solid transparent; font: italic 700 13px var(--font); text-transform: uppercase; letter-spacing: .02em; cursor: pointer; white-space: nowrap; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: #E6B252; }
.btn-dark { background: #111; color: #fff; border-color: #333; }
.btn-dark:hover { background: #222; }
.btn-line { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: #bbb; }
.btn-danger { color: var(--red); }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #f0eee9; color: var(--red); }
.icon-btn svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; }
.only-mobile { display: none; }

/* ── layout ── */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 280px; gap: 18px; padding: 18px; align-items: start; max-width: 1600px; margin: 0 auto; }
.side, .summary { position: sticky; top: 76px; }
.side { max-height: calc(100vh - 94px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.side-head { padding: 14px 12px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-title h2 { margin: 0; font-size: 14px; }
.side-title h2 span { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--gold-soft); color: #9A6E1F; font: normal 500 11px var(--font); vertical-align: 2px; }
.cl-top, .cl-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-date { font-size: 11px; color: var(--ink-3); }
.cl-vend { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(216,161,63,.6); color: #9A6E1F; display: inline-flex; align-items: center; justify-content: center; font: italic 700 9px var(--font); flex: none; }
input.is-dup { border-color: var(--red); background: #FDF3F1; }
.cot-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.cot-list button { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: grid; gap: 1px; font: inherit; color: inherit; }
.cot-list button:hover { background: #f6f5f2; }
.cot-list button.is-on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.cl-nro { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; }
.cl-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-tot { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cl-empty { padding: 14px; color: var(--ink-3); }

.main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }

/* ── campos ── */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-top: 12px; }
.grid label { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
input, select, textarea {
  font: 400 14px var(--font); color: var(--ink); background: #fff; width: 100%;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,161,63,.18); }
input:disabled { background: #f6f5f2; color: var(--ink-3); }

/* ── buscador de productos ── */
.search { position: relative; margin-bottom: 14px; }
.search input { padding: 12px 14px; font-size: 15px; background: #faf9f7; }
.search-res { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.search input { padding-right: 140px; }
.btn-cat {
  position: absolute; right: 6px; top: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer;
  font: 500 12px var(--font); color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em;
}
.btn-cat:hover { border-color: var(--gold); color: var(--ink); }
.btn-cat svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.btn-cat.is-open svg { transform: rotate(180deg); }
.search-panel { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); overflow: hidden; }
.search-panel .search-res { position: static; border: 0; border-radius: 0; box-shadow: none; }
.search-tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); }
.search-tabs button {
  border: 0; background: transparent; cursor: pointer; padding: 8px 12px 10px; margin-bottom: -1px;
  font: 500 13px var(--font); color: var(--ink-3); border-bottom: 2px solid transparent;
}
.search-tabs button span { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #f1efea; font-size: 11px; color: var(--ink-3); }
.search-tabs button:hover { color: var(--ink); }
.search-tabs button.is-on { color: var(--ink); border-bottom-color: var(--gold); }
.search-tabs button.is-on span { background: var(--gold-soft); color: #9A6E1F; }
.search-res .sr-item.no-img { grid-template-columns: 1fr auto 28px; padding-left: 14px; }
.sr-item.no-img .sr-desc small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }
.search-res { max-height: 480px; overflow-y: auto; overscroll-behavior: contain; }
.search-res .sr-cat {
  position: sticky; top: -6px; z-index: 1; margin: 0 -6px; padding: 10px 16px 6px; background: #fff;
  font: italic 700 12px var(--font); color: var(--gold-ink, #9A6E1F); text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--line);
}
.search-res .sr-item { display: grid; grid-template-columns: 44px 1fr auto 28px; gap: 12px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.search-res .sr-item.is-hi, .search-res .sr-item:hover { background: var(--gold-soft); }
.sr-add { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 16px; }
.sr-item:hover .sr-add, .sr-item.is-hi .sr-add { border-color: var(--gold); background: var(--gold); color: #000; }
.sr-in { font-weight: 500; color: #1C7A50; margin-left: 6px; }
.sr-empty { padding: 16px; color: var(--ink-3); text-align: center; }
.sr-img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.sr-desc { font-weight: 700; display: flex; flex-direction: column; }
.sr-desc small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.sr-price { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; display: flex; flex-direction: column; align-items: flex-end; }
.sr-price small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.sr-price em { font-style: normal; color: #B5651D; font-size: 12px; }
.td-price { position: relative; }
.in-price.is-warn { border-color: #E9A23B; background: #FFF6E6; }
.warn-dot { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #E9A23B; color: #fff; font: 900 11px var(--font); vertical-align: 1px; }
.td-price .warn-dot { position: absolute; top: -1px; right: -2px; }
.in-fin { color: var(--ink-2); }
.hint-after { margin: 12px 0 0; }

/* ── tabla de ítems ── */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; min-width: 1100px; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 0 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 5px 4px; border-bottom: 1px solid #f0eee9; }
.tbl input, .tbl select { padding: 7px 8px; font-size: 13px; }
.tbl .num, .tbl th.num { text-align: right; }
.tbl td.sub { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; padding-left: 10px; }
.w-desc { width: 32%; }
.in-code { width: 86px; }
.in-um { width: 54px; }
.in-num { width: 76px; text-align: right; }
.in-price { width: 118px; text-align: right; }
.in-pct { width: 62px; text-align: right; }
.tbl select { width: 150px; }
.empty-items { color: var(--ink-3); text-align: center; padding: 20px 0 6px; margin: 0; }

/* ── pagos ── */
.pagos { display: flex; flex-direction: column; gap: 8px; }
.pago { display: grid; grid-template-columns: 1.2fr 110px 1.6fr; gap: 14px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.pago.is-off { opacity: .55; }
.pago .chk { flex-direction: row; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.pago .chk span { display: flex; flex-direction: column; }
.pago .chk small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.pago.is-vencida small { color: var(--red); }
.pago .chk input { width: 18px; height: 18px; accent-color: var(--gold); }
.pago .mini { margin: 0; font-size: 11px; }
.pago .mini input { padding: 6px 8px; }
.pago-res { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }

/* ── garantías ── */
.garantias { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gar { display: grid; grid-template-columns: 1fr 160px 32px; gap: 8px; }

.danger-zone { display: flex; justify-content: flex-end; gap: 8px; padding-bottom: 30px; }

/* ── resumen ── */
.sum-card { background: #000; color: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.sum-lbl { margin: 0; color: #999; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sum-total { margin: 0; color: var(--gold); font: italic 900 28px/1.15 var(--font); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sum-rows { border-top: 1px solid #2a2a2a; padding-top: 10px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sum-rows div { display: flex; justify-content: space-between; gap: 10px; }
.sum-rows span:first-child { color: #999; }
.sum-rows span:last-child { font-variant-numeric: tabular-nums; }
.sum-card .btn { width: 100%; }
.sum-card .btn-line { background: transparent; color: #fff; border-color: #444; }
.sum-saved { margin: 4px 0 0; text-align: center; font-size: 12px; color: #777; transition: color .3s; }
.sum-saved.pulse { color: var(--gold); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #111; color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700; transition: .2s; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── responsive ── */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .summary { position: sticky; top: auto; bottom: 0; grid-column: 1 / -1; z-index: 15; margin: 0 -18px -18px; }
  .sum-card { border-radius: 16px 16px 0 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; }
  .sum-card .btn { width: auto; }
  .sum-lbl, .sum-rows, .sum-saved { display: none; }
  .sum-total { font-size: 22px; margin-right: auto; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .side { top: 70px; max-height: calc(100vh - 160px); }
  .summary { margin: 0 -12px -12px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .pago { grid-template-columns: 1fr 100px; }
  .pago-res { grid-column: 1 / -1; }
  .sum-card .btn { flex: 1 1 auto; padding: 0 12px; }
  .sum-total { flex-basis: 100%; }
  .bar-tag { display: none; }
}
/* celular: la lista de cotizaciones pasa al menú ☰ */
@media (max-width: 640px) {
  .only-mobile { display: inline-flex; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 58px; left: 0; bottom: 0; width: 290px; max-height: none; border-radius: 0; z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  body.side-open .side { transform: none; }
}
.sum-rows .sum-ct { margin-top: 4px; padding-top: 6px; border-top: 1px dashed #2a2a2a; }
.sum-rows .sum-ct span { color: var(--gold) !important; }
.vend-datos { margin-top: 14px; }
.cl-nro, .cl-date { white-space: nowrap; }
.side-title h2 { white-space: nowrap; }
.side-title h2::before { display: none; }
.side-title .btn-sm { height: 28px; padding: 0 10px; font-size: 11px; flex: none; }
@media (max-width: 820px) { .side-title h2 { font-size: 12px; } .side-title h2 span { display: none; } }

/* ── barra: botones con ícono y usuario ── */
.bar-r { display: flex; align-items: center; gap: 8px; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-user { text-transform: none; font-style: normal; font-weight: 500; color: #bbb; }
@media (max-width: 820px) { #btnListas span { display: none; } }


/* ── ventana de listas de precios ── */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: rgba(10,10,10,.55); backdrop-filter: blur(3px); overflow-y: auto; }
.modal[hidden], .login[hidden] { display: none; }
.modal-card { width: min(760px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; max-height: 88vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #faf9f7; border-radius: 0 0 18px 18px; }
.lp-tipo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.lp-tipo label { margin: 0; flex-direction: row; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink); font-size: 14px; }
.lp-tipo label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); background: var(--gold-soft); }
.lp-tipo input { width: 18px; height: 18px; accent-color: var(--gold); }
.lp-tipo span { display: flex; flex-direction: column; }
.lp-tipo small { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.lp-drop { margin: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 150px; padding: 20px; border: 1.5px dashed #d6d0c4; border-radius: 14px; background: #faf9f7; cursor: pointer; text-align: center; color: var(--ink-2); font-size: 14px; font-weight: 500; transition: border-color .15s, background .15s; }
.lp-drop:hover, .lp-drop.is-over { border-color: var(--gold); background: var(--gold-soft); }
.lp-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.lp-drop svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; }
.lp-local { margin-right: auto; color: #B5651D; font-size: 13px; }
.lp-cargando { display: flex; align-items: center; gap: 18px; padding: 40px 24px; color: var(--ink-2); }
.lp-cargando p { margin: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--gold-soft); border-top-color: var(--gold); animation: girar .9s linear infinite; flex: none; }
@keyframes girar { to { transform: rotate(360deg); } }
.lp-resumen { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lp-chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.lp-chip b { font-weight: 700; color: var(--ink); }
.lp-chip.is-nuevo { border-color: #BFE3CF; background: #F1FAF5; }
.lp-chip.is-precio { border-color: rgba(216,161,63,.5); background: var(--gold-soft); }
.lp-chip.is-baja { border-color: #F3C9C0; background: #FDF3F1; }
.lp-notas { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #f6f5f2; font-size: 13px; color: var(--ink-2); }
.lp-sec { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lp-sec > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #faf9f7; border-bottom: 1px solid var(--line); }
.lp-sec h3 { margin: 0; font: italic 700 14px var(--font); }
.lp-sec h3 span { margin-left: 6px; font: normal 500 12px var(--font); color: var(--ink-3); }
.lp-sec.is-nuevo { border-left: 3px solid var(--green, #32B67C); }
.lp-sec.is-precio { border-left: 3px solid var(--gold); }
.lp-sec.is-baja { border-left: 3px solid var(--red); }
.lp-sec .hint { margin: 10px 14px 0; }
.lp-sec ul { list-style: none; margin: 0; padding: 6px; }
.lp-sec li label { margin: 0; flex-direction: row; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 500; }
.lp-sec li label:hover { background: #faf9f7; }
.lp-sec li input { width: 17px; height: 17px; flex: none; accent-color: var(--gold); }
.lp-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lp-nom small { font-weight: 400; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-precio { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.lp-precio s { color: var(--ink-3); }
.lp-precio b { color: var(--ink); }
.lp-precio em { margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-style: normal; font-size: 12px; }
.lp-precio em.sube { background: #FDF3F1; color: #A3311F; }
.lp-precio em.baja { background: #F1FAF5; color: #1C7A50; }
.lp-todos { border: 0; background: none; color: #9A6E1F; font: 500 12px var(--font); cursor: pointer; }
.lp-iguales { margin: 14px 2px 0; color: var(--ink-3); font-size: 13px; }
@media (max-width: 640px) { .lp-tipo { grid-template-columns: 1fr; } .lp-sec li label { flex-wrap: wrap; } .lp-precio { width: 100%; padding-left: 29px; } }
.modal [hidden] { display: none !important; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── ingreso (login) ── */
.login { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px; color: #fff;
  background: radial-gradient(ellipse 70% 55% at 100% 0%, rgba(216,161,63,.22), transparent 70%), #0A0A0A;
}
.login-brand::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,161,63,.6), transparent); }
.login-logo { height: 24px; width: auto; align-self: flex-start; position: relative; z-index: 1; }
.login-claim { position: relative; z-index: 1; max-width: 440px; }
.login-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; color: var(--gold); font: 500 12px var(--font); text-transform: uppercase; letter-spacing: .2em; }
.login-eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.login-claim h1 { margin: 0; font: italic 700 clamp(30px, 3.4vw, 44px)/1.12 var(--font); letter-spacing: -.02em; }
.login-text { margin: 18px 0 0; color: #9a9a9a; font-size: 15px; line-height: 1.6; max-width: 380px; }
.login-tag { position: relative; z-index: 1; margin: 0; color: var(--gold); font: italic 700 13px var(--font); }
.login-bolt { position: absolute; right: -30px; bottom: -40px; height: 420px; fill: none; stroke: rgba(216,161,63,.35); stroke-width: 1; }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px 24px; background: #FAF9F7; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-card h2 { margin: 0; font: italic 700 28px var(--font); text-transform: none; letter-spacing: -.01em; }
.login-card h2::before { display: none; }
.login-logo-m { display: none; }
.login-sub { margin: -8px 0 8px; color: var(--ink-3); font-size: 14px; }
.login .fld { margin: 0; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.login .fld input { height: 48px; padding: 0 14px; font-size: 15px; border-radius: 10px; text-transform: none; letter-spacing: 0; background: #fff; }
.pass { position: relative; display: block; }
.pass input { padding-right: 48px !important; }
.pass-ver { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; }
.pass-ver:hover, .pass-ver.is-on { color: var(--ink); background: #f3f1ec; }
.pass-ver svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.recordar { margin: 0; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.recordar input { width: 16px; height: 16px; accent-color: var(--gold); }
.login-btn { height: 50px; width: 100%; margin-top: 4px; font-size: 14px; border-radius: 10px; position: relative; }
.login-btn.is-loading span { opacity: 0; }
.login-btn.is-loading::after { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(0,0,0,.2); border-top-color: #000; animation: girar .8s linear infinite; }
.login-err { min-height: 18px; margin: 0; color: var(--red); font-size: 13px; text-align: center; }
.login-foot { margin: 0; color: var(--ink-3); font-size: 12px; }
.login-card.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
body.con-login { overflow: hidden; }

@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .login-brand { padding: 22px 20px 26px; gap: 18px; }
  .login-claim h1 { font-size: 24px; }
  .login-text { display: none; }
  .login-tag { display: none; }
  .login-bolt { height: 220px; right: -20px; bottom: -60px; }
  .login-main { justify-content: flex-start; padding: 28px 20px 24px; }
}
/* iPhone: con letra de menos de 16px en los campos, Safari hace zoom al tocarlos */
@media (max-width: 640px) { input, select, textarea, .login .fld input { font-size: 16px; } }

/* ── celular: productos como tarjetas y barra inferior compacta ── */
@media (max-width: 640px) {
  .panel { padding: 16px; border-radius: 12px; }
  .tbl-wrap { overflow: visible; margin: 0; padding: 0; }
  .tbl { min-width: 0; display: block; }
  .tbl thead { display: none; }
  .tbl tbody { display: flex; flex-direction: column; gap: 10px; }
  .tbl tr {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 8px; position: relative;
    padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  }
  .tbl td { padding: 0; border: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .tbl td[data-l]::before { content: attr(data-l); font-size: 10px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
  .tbl input, .tbl select { width: 100% !important; height: 42px; }
  .tbl tr { grid-template-areas: "desc desc desc desc desc desc" "cat cat cat cat code code" "q q um p p p" "ds ds iva sub sub sub"; }
  .tbl .c-desc { grid-area: desc; padding-right: 34px; }
  .tbl .c-desc input { font-weight: 700; }
  .tbl .c-cat { grid-area: cat; }
  .tbl .c-code { grid-area: code; }
  .tbl .c-q { grid-area: q; }
  .tbl .c-um { grid-area: um; }
  .tbl .c-p { grid-area: p; }
  .tbl .c-ds { grid-area: ds; }
  .tbl .c-iva { grid-area: iva; }
  .tbl .c-sub { grid-area: sub; justify-content: flex-end; align-items: flex-end; padding: 0 2px 10px 0; font-size: 15px; }
  .tbl .c-del { position: absolute; top: 8px; right: 6px; }
  .search input { padding-right: 130px; }

  /* barra inferior: total arriba chico, tres botones en una fila */
  .sum-card { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .sum-total { font-size: 19px; flex-basis: 100%; }
  .sum-card .btn { flex: 1 1 0; height: 40px; padding: 0 6px; font-size: 11px; }
}
@media (max-width: 640px) { .d-only { display: none; } }
@media (max-width: 640px) {
  body.side-open::before { content: ''; position: fixed; inset: 58px 0 0 0; z-index: 29; background: rgba(10,10,10,.45); }
}
.vend-datos + .hint { margin-top: 10px; }

/* productos con varios modelos (BFR, bancos de salto, discos…) */
.search-res .sr-grupo { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 10px 10px 4px; }
.search-res .sr-grupo.no-img { grid-template-columns: 1fr; padding-left: 14px; }
.sr-grupo .sr-desc small { color: #9A6E1F; }
.search-res .sr-item.sr-var { grid-template-columns: 1fr auto 28px; margin-left: 66px; padding: 6px 10px; border-left: 2px solid var(--gold-soft); border-radius: 0 8px 8px 0; }
.search-res .sr-grupo.no-img ~ .sr-var { margin-left: 22px; }
.sr-var .sr-desc { font-weight: 500; }
@media (max-width: 640px) { .search-res .sr-item.sr-var { margin-left: 22px; } }
