:root {
  --ink: #2a1f17; --muted: #7a6a5a; --line: #e8dfcf; --line-strong: #d6c7ae;
  --canvas: #f4eee2; --surface: #fffdf8;
  --wood-950: #24180f; --wood-900: #33231a; --wood-800: #4a3222; --wood-600: #8a5a35; --wood-100: #f3e7d6;
  --pasture: #4f6f35; --pasture-soft: #e6eed8; --ochre: #c88a14; --ochre-soft: #fbefcf; --tag: #f2c230;
  --terra: #b5542d; --terra-dark: #93401f; --terra-soft: #f8e2d7; --red: #a33b2b; --red-soft: #f9e1dc;
  --blue: #3f6b84; --blue-soft: #e3edf2;
  --slab: "Rockwell", "Roboto Slab", "Zilla Slab", "Georgia", serif;
  --radius: 10px; --shadow: 0 18px 44px rgba(52,33,18,.16); --shadow-soft: 0 2px 0 rgba(90,60,30,.06), 0 8px 20px rgba(90,60,30,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); font-size: 15px; line-height: 1.45; padding-top: 30px;
  background: var(--canvas) radial-gradient(rgba(138,90,53,.07) 1px, transparent 1.2px) 0 0 / 14px 14px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--slab); font-weight: 700; letter-spacing: -.01em; }

/* ---------- franja demo ---------- */
.demo-strip { position: fixed; inset: 0 0 auto 0; height: 30px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--tag); color: var(--wood-950); font-size: .76rem; font-weight: 700; }
.demo-strip .tag { padding: 2px 8px; border-radius: 4px; background: var(--wood-950); color: var(--tag); font-size: .66rem; font-weight: 900; letter-spacing: .12em; }
.demo-strip .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-strip button { padding: 3px 11px; border: 1.5px solid var(--wood-950); border-radius: 4px; background: transparent; color: var(--wood-950); font-size: .72rem; font-weight: 800; }

/* ---------- cabecera con navegación superior ---------- */
.ranch-header { position: sticky; top: 30px; z-index: 30; color: #f4e9d8; background: var(--wood-950) repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 2px, transparent 2px 9px); border-bottom: 4px solid var(--terra); box-shadow: 0 6px 18px rgba(36,24,15,.25); }
.rh-top { display: flex; align-items: center; gap: 22px; padding: 10px 26px; }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
button.brand { border: 0; background: transparent; padding: 0; color: inherit; text-align: left; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--tag); color: var(--wood-950); border: 3px solid #fff3c9; }
.brand strong { display: block; font-family: var(--slab); font-size: 1.15rem; letter-spacing: .02em; }
.brand span { display: block; color: #cdb99c; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.group-tabs { display: flex; gap: 4px; margin-left: 10px; flex: 1; min-width: 0; }
.group-tab { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 8px 8px 0 0; background: transparent; color: #d9c6a8; font-family: var(--slab); font-weight: 700; font-size: .98rem; position: relative; top: 11px; padding-bottom: 20px; }
.group-tab:hover { color: #fff; background: rgba(255,255,255,.05); }
.group-tab.active { color: var(--wood-950); background: var(--canvas); }
.group-tab .gcount { min-width: 20px; height: 19px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--terra); color: #fff; font-family: "Segoe UI", sans-serif; font-size: .64rem; font-weight: 900; }
.group-tab .gcount:empty { display: none; }
.top-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.sede-select { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.06); font-size: .74rem; font-weight: 800; color: #cdb99c; text-transform: uppercase; letter-spacing: .06em; }
.sede-select select { border: 0; background: var(--tag); border-radius: 6px; padding: 6px 8px; font-weight: 800; color: var(--wood-950); text-transform: none; letter-spacing: 0; }
.sub-tabs { display: flex; gap: 2px; padding: 0 26px; background: var(--canvas); border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: thin; }
.sub-tab { display: flex; align-items: center; gap: 7px; padding: 12px 14px 10px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 700; font-size: .87rem; white-space: nowrap; }
.sub-tab:hover { color: var(--ink); }
.sub-tab.active { color: var(--terra-dark); border-bottom-color: var(--terra); }
.nav-count { min-width: 20px; height: 18px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--wood-100); color: var(--wood-800); font-size: .64rem; font-weight: 900; }
.nav-count.risk { background: var(--terra); color: #fff; }
.nav-count:empty { display: none; }

.page-title-row { max-width: 1640px; margin: 0 auto; display: flex; align-items: flex-end; gap: 16px; padding: 22px 26px 0; }
.page-heading { margin-right: auto; min-width: 0; }
.eyebrow, .page-heading p { margin: 0 0 3px; color: var(--terra); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-size: 1.85rem; color: var(--wood-900); }

/* ---------- botones ---------- */
.button { min-height: 40px; padding: 8px 15px; border: 1.5px solid transparent; border-radius: 8px; font-weight: 750; transition: .14s; display: inline-flex; align-items: center; gap: 7px; justify-content: center; text-decoration: none; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--terra); color: #fff; box-shadow: 0 3px 0 var(--terra-dark); }
.button.primary:hover { background: var(--terra-dark); }
.button.primary:active { transform: translateY(2px); box-shadow: none; }
.button.secondary { background: var(--surface); color: var(--wood-800); border-color: var(--line-strong); }
.button.lime { background: var(--tag); color: var(--wood-950); box-shadow: 0 3px 0 #b58d12; }
.button.glass { background: rgba(255,255,255,.08); color: #f4e9d8; border-color: rgba(255,255,255,.25); }
.button.danger { background: var(--red); color: #fff; }
.button.small { min-height: 32px; padding: 5px 10px; font-size: .8rem; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 1.2rem; }

main { max-width: 1640px; margin: 0 auto; padding: 18px 26px 56px; }
.view { display: grid; gap: 18px; }

/* ---------- paneles ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--wood-600); border-radius: var(--radius); box-shadow: var(--shadow-soft); overflow: hidden; min-width: 0; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 15px 18px 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 2px 0 0; font-size: 1.15rem; color: var(--wood-900); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; max-width: 780px; }
.panel-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 0 18px 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.35fr); gap: 18px; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0,1fr)); }

/* ---------- parte diario (resumen) ---------- */
.parte { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center; padding: 22px 26px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface) repeating-linear-gradient(180deg, transparent 0 31px, rgba(181,84,45,.10) 31px 32px); box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.parte::before { content: ""; position: absolute; left: 70px; top: 0; bottom: 0; width: 2px; background: rgba(181,84,45,.25); }
.parte-date { display: flex; gap: 18px; align-items: center; padding-left: 70px; }
.parte-day { position: absolute; left: 12px; top: 20px; width: 46px; text-align: center; font-family: var(--slab); }
.parte-day b { display: block; font-size: 1.9rem; line-height: 1; color: var(--terra); }
.parte-day small { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.parte h2 { margin: 0; font-size: 1.7rem; color: var(--wood-900); }
.parte p { margin: 4px 0 0; color: var(--muted); }
.parte-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.parte-stats div { font-size: .8rem; color: var(--muted); }
.parte-stats strong { display: block; font-family: var(--slab); font-size: 1.35rem; color: var(--ink); }
.parte-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.stamp { position: absolute; right: 250px; top: 16px; padding: 6px 12px; border: 3px double var(--terra); border-radius: 6px; color: var(--terra); font-family: var(--slab); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; transform: rotate(-8deg); opacity: .55; }

/* ---------- fichas (métricas) ---------- */
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; }
.metric { position: relative; padding: 14px 16px 14px 18px; border: 1px solid var(--line); border-left: 6px solid var(--pasture); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-soft); text-align: left; min-width: 0; }
button.metric { cursor: pointer; transition: .15s; }
button.metric:hover { transform: translateY(-2px); }
.metric > span { display: block; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding-right: 34px; }
.metric > strong { display: block; margin-top: 6px; font-family: var(--slab); font-size: 1.6rem; color: var(--wood-900); }
.metric > small { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; }
.metric.alert { border-left-color: var(--terra); background: linear-gradient(90deg, var(--terra-soft), var(--surface) 60%); }
.metric.good { border-left-color: var(--pasture); background: linear-gradient(90deg, var(--pasture-soft), var(--surface) 60%); }
.metric .ico { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--wood-100); color: var(--wood-600); font-weight: 900; font-size: .8rem; font-style: normal; }
.metric.alert .ico { background: var(--terra); color: #fff; }

/* ---------- mapa de corrales ---------- */
.pen-sedes { display: grid; gap: 16px; padding: 0 18px 18px; }
.pen-sede h3 { margin: 0 0 8px; font-size: .95rem; color: var(--wood-800); display: flex; justify-content: space-between; align-items: center; }
.pen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px,1fr)); gap: 10px; }
.pen { position: relative; min-height: 104px; padding: 0; border: 3px solid var(--wood-600); border-radius: 4px; text-align: left; overflow: hidden; background: #f7f0de repeating-linear-gradient(90deg, transparent 0 24px, rgba(138,90,53,.14) 24px 27px); transition: .15s; }
.pen::before, .pen::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: rgba(138,90,53,.35); z-index: 1; }
.pen::before { top: 34%; }
.pen::after { top: 64%; }
.pen:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(90,60,30,.18); }
.pen-hit { position: relative; z-index: 2; display: block; width: 100%; min-height: 104px; padding: 8px 10px 26px; border: 0; background: transparent; text-align: left; color: inherit; font: inherit; }
.pen-hit > span { position: relative; z-index: 2; display: block; }
.pen-cap { position: absolute; z-index: 3; right: 6px; bottom: 6px; min-width: 28px; padding: 1px 7px; border: 1px solid var(--wood-600); border-radius: 4px; background: #fffdf8; color: var(--wood-900); font-weight: 800; font-size: .72rem; }
.sin-corral { display: block; width: 100%; margin: 0 0 10px; padding: 8px 12px; border: 1px dashed var(--terra); border-radius: 6px; background: var(--terra-soft); color: var(--wood-900); font-weight: 700; text-align: left; }
.raza-picks { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 0 18px 14px; }
.raza-picks.inline { padding: 0; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: .8rem; font-weight: 700; }
.check-chip.on { border-color: var(--terra); background: var(--terra-soft); }
.camal-check { width: 18px; height: 18px; accent-color: var(--terra); }
.camal-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 18px 14px; padding: 10px 12px; border-radius: 8px; background: var(--ochre-soft); }
.camal-voice { margin-top: 0; }
.camal-voice input { flex: 1; min-width: 180px; color: var(--ink); background: #fff; }
#voicePreview { margin: 0 18px 14px; }
#voicePreview:empty { display: none; }
tr.camal-row td { background: #fbf3df; }
button.metric { font: inherit; color: inherit; width: 100%; }
.pen-fill { position: absolute !important; left: 0; right: 0; bottom: 0; z-index: 0 !important; background: linear-gradient(180deg, rgba(122,160,74,.35), rgba(79,111,53,.55)); }
.pen-num { font-family: var(--slab); font-weight: 700; font-size: .78rem; color: var(--wood-600); letter-spacing: .08em; text-transform: uppercase; }
.pen-count { font-family: var(--slab); font-size: 1.55rem; font-weight: 700; color: var(--wood-950); line-height: 1.1; }
.pen-count small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pen-breed { font-size: .72rem; font-weight: 700; color: var(--wood-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pen-flag { position: absolute !important; top: 7px; right: 7px; padding: 1px 6px; border-radius: 4px; background: var(--terra); color: #fff; font-size: .62rem; font-weight: 900; }
.pen.empty { border-style: dashed; opacity: .7; }
.pen.over { border-color: var(--red); }

/* ---------- tablas ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 9px 12px; border-block: 1px solid var(--line-strong); background: var(--wood-100); color: var(--wood-600); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; text-align: left; }
.data-table td { padding: 9px 12px; border-bottom: 1px dashed #eadfcb; font-size: .85rem; vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: #fcf8f0; }
.data-table tbody tr:hover { background: var(--ochre-soft); }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.muted-row { opacity: .6; }
.data-table td.wrap { white-space: normal; min-width: 200px; max-width: 300px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.main { display: block; font-weight: 720; }
.sub { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; }
.inline-sub { color: var(--muted); font-size: .74rem; margin-left: 6px; }
.table-actions { display: flex; gap: 4px; }
.action-link { border: 0; background: transparent; color: var(--terra-dark); padding: 5px 7px; border-radius: 6px; font-size: .8rem; font-weight: 800; }
.action-link:hover { background: var(--terra-soft); }
.action-link.danger { color: var(--red); }
.cell-low { background: var(--red-soft) !important; color: var(--red); font-weight: 800; }
.col-hl { background: rgba(242,194,48,.16); }

/* arete amarillo para números de animal y códigos */
.tag-num { position: relative; display: inline-block; padding: 2px 9px 2px 17px; border-radius: 12px 12px 14px 14px / 9px 9px 14px 14px; background: var(--tag); color: #3a2a0a; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 800; font-size: .8rem; box-shadow: inset 0 -2px 0 rgba(0,0,0,.14); white-space: nowrap; }
.tag-num::before { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--canvas); box-shadow: inset 0 1px 1px rgba(0,0,0,.35); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; background: var(--wood-100); color: var(--wood-800); white-space: nowrap; }
.badge.ok { background: var(--pasture-soft); color: var(--pasture); }
.badge.warn { background: var(--ochre-soft); color: #8c5f07; }
.badge.risk { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.muted { background: #efe9df; color: var(--muted); }
.badge.leather { background: var(--wood-100); color: var(--wood-600); }
.badge.dark { background: var(--wood-950); color: #f4e9d8; }
.bar { position: relative; width: 96px; height: 8px; border-radius: 2px; background: #eadfcb; overflow: hidden; display: inline-block; vertical-align: middle; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--pasture); }
.bar.warn i { background: var(--ochre); }
.bar.risk i { background: var(--terra); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 0 18px 14px; }
.toolbar input, .toolbar select { min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.toolbar input[type=search] { min-width: 260px; flex: 1; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.hint { color: var(--muted); font-size: .8rem; }

.alert-list { display: grid; gap: 8px; padding: 0 18px 18px; }
.alert-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 6px; background: var(--surface); text-align: left; width: 100%; }
.alert-item:hover { background: #fcf8f0; }
.alert-item.excedido { border-left-color: var(--terra); }
.alert-item.listo { border-left-color: var(--pasture); }
.alert-item.proximo { border-left-color: var(--ochre); }
.alert-item .ai-main { flex: 1; min-width: 0; }
.alert-item strong { display: block; font-size: .86rem; }
.alert-item small { display: block; color: var(--muted); font-size: .76rem; }
.alert-block.open .alert-item { border-radius: 6px 6px 0 0; border-left-color: var(--terra); }
.listo-detail { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: #fffdf8; overflow: hidden; }
.listo-detail .toolbar { padding-top: 12px; }
.feed { list-style: none; margin: 0; padding: 0 18px 18px; display: grid; gap: 10px; }
.feed li { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; }
.feed .fi { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--pasture-soft); color: var(--pasture); }
.feed .fi.risk { background: var(--terra-soft); color: var(--terra); }
.feed .fi.info { background: var(--blue-soft); color: var(--blue); }
.feed .fi.leather { background: var(--wood-100); color: var(--wood-600); }
.feed small { display: block; color: var(--muted); font-size: .72rem; }

.motivo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px,1fr)); gap: 10px; padding: 0 18px 18px; }
.motivo-card { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fcf8f0; }
.motivo-card strong { display: block; font-family: var(--slab); font-size: 1.5rem; margin: 6px 0 2px; }
.motivo-card p { margin: 0; color: var(--muted); font-size: .76rem; }

.kv-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.kv { padding: 9px 12px; border-radius: 6px; background: #f8f1e4; border-left: 3px solid var(--wood-600); min-width: 0; }
.kv span { display: block; font-size: .66rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.kv strong { display: block; margin-top: 3px; font-size: .9rem; overflow-wrap: anywhere; }
.kv.full { grid-column: 1 / -1; }
.mt { margin-top: 14px; }

/* ---------- diálogos y formularios ---------- */
dialog { padding: 0; border: 0; border-radius: 10px; box-shadow: var(--shadow); width: min(780px, calc(100vw - 24px)); max-height: calc(100vh - 30px); color: var(--ink); background: var(--surface); }
dialog.wide { width: min(1120px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(36,24,15,.62); backdrop-filter: blur(2px); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 30px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 22px 13px; color: #f4e9d8; background: var(--wood-950); border-bottom: 4px solid var(--terra); }
.dialog-head .eyebrow { color: var(--tag); }
.dialog-head h2 { margin: 0; font-size: 1.28rem; }
.dialog-head .icon-button { background: transparent; color: #f4e9d8; border-color: rgba(255,255,255,.25); }
.dialog-body { padding: 18px 22px; overflow-y: auto; }
.dialog-error { margin: 0 22px 10px; padding: 9px 12px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-weight: 700; font-size: .85rem; }
.dialog-error:empty { display: none; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #faf5ea; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field { display: grid; gap: 5px; align-content: start; }
.full { grid-column: 1 / -1; }
.field > span { font-size: .72rem; font-weight: 800; color: var(--wood-800); letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fffefb; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(181,84,45,.25); border-color: var(--terra); }
.field input.auto { background: var(--ochre-soft); font-weight: 900; color: #6d4a06; border: 2px dashed var(--ochre); }
.subgrid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 14px; padding: 12px; border: 1.5px dashed var(--wood-600); border-radius: 8px; background: var(--wood-100); }
.subgrid .sg-title { grid-column: 1 / -1; font-size: .78rem; font-weight: 850; color: var(--wood-600); }
.preview { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--pasture-soft); border-left: 4px solid var(--pasture); color: #2f4520; font-size: .86rem; display: grid; gap: 8px; }
.preview.bad { background: var(--red-soft); border-left-color: var(--red); color: var(--red); }
.preview .big { font-family: var(--slab); font-size: 1.12rem; }
.preview .warn-line { color: #8c5f07; font-weight: 700; }
.preview .err-line { color: var(--red); font-weight: 750; }
.corr-strip { display: flex; flex-wrap: wrap; gap: 5px; }
.corr-strip span { position: relative; padding: 2px 7px 2px 14px; border-radius: 10px 10px 12px 12px / 8px 8px 12px 12px; background: var(--tag); font-family: ui-monospace, Consolas, monospace; font-size: .72rem; font-weight: 800; color: #3a2a0a; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.corr-strip span::before { content: ""; position: absolute; left: 5px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #fff; }
.corr-strip span.first, .corr-strip span.last { background: var(--terra); color: #fff; }
.inp-sel { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fffefb; }
.inp-sm { width: 92px; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; text-align: right; background: #fffefb; }
.inp-sm.auto { background: var(--ochre-soft); border-color: var(--ochre); font-weight: 800; }

/* ---------- comando de voz ---------- */
.voice-panel { background: var(--wood-900) repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 2px, transparent 2px 10px); color: #f4e9d8; border: 0; border-top: 4px solid var(--tag); }
.voice-panel .eyebrow { color: var(--tag); }
.voice-panel h2 { color: #fff; }
.voice-panel .panel-head p { color: #cdb99c; }
.voice-row { display: flex; gap: 10px; align-items: center; padding: 0 18px; }
.voice-row input { flex: 1; min-width: 0; min-height: 50px; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #fff; font-size: 1rem; }
.voice-row input::placeholder { color: #a8957b; }
.mic { width: 58px; height: 58px; border-radius: 50%; border: 3px solid #fff3c9; background: var(--tag); color: var(--wood-950); display: grid; place-items: center; flex: 0 0 auto; }
.mic.listening { background: var(--terra); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(181,84,45,.6); } 100% { box-shadow: 0 0 0 18px rgba(181,84,45,0); } }
.mic-status { padding: 6px 18px 0 86px; color: #a8957b; font-size: .76rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 16px; }
.chip { padding: 6px 10px; border-radius: 4px; border: 1px dashed rgba(242,194,48,.5); background: rgba(242,194,48,.08); color: #f0dfbf; font-size: .78rem; font-weight: 700; }
.chip:hover { background: rgba(242,194,48,.18); }
#voicePreview:not(:empty) { padding: 0 18px 18px; }
.cmd-card { padding: 14px; border-radius: 8px; background: var(--surface); color: var(--ink); display: grid; gap: 12px; border-left: 6px solid var(--tag); }
.cmd-card.bad { background: #fff3ef; color: var(--red); border-left-color: var(--red); }
.cmd-card p { margin: 0; }
.cmd-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cmd-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.cmd-grid > div { padding: 10px; border-radius: 6px; background: #f8f1e4; }
.cmd-grid small { display: block; font-size: .66rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cmd-grid strong { display: block; margin-top: 3px; font-family: var(--slab); }
.cmd-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- fichas de animal y ticket ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px,1fr)); gap: 12px; padding: 0 18px 18px; }
.animal-card { border: 1px solid var(--line-strong); border-top: 4px solid var(--tag); border-radius: 8px; padding: 14px; background: #fffdf6; }
.animal-card h3 { margin: 0; font-size: 1.1rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline { list-style: none; margin: 12px 0 0 6px; padding: 0 0 0 16px; border-left: 2px dashed var(--line-strong); }
.timeline li { position: relative; padding: 0 0 11px 4px; font-size: .82rem; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--pasture); box-shadow: 0 0 0 3px var(--surface); }
.timeline li.out::before { background: var(--terra); }
.timeline li.mv::before { background: var(--blue); }
.timeline li.rz::before { background: var(--ochre); }
.timeline small { display: block; color: var(--muted); font-size: .72rem; }

.ticket-drop { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0 18px 14px; padding: 14px; border: 2px dashed var(--line-strong); border-radius: 8px; background: #fcf8f0; }
.ticket-drop select, .ticket-drop input[type=file] { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.ticket-lines { margin: 0 18px 14px; padding: 14px 16px; border-radius: 4px; background: #fffbea repeating-linear-gradient(180deg, transparent 0 19px, rgba(0,0,0,.05) 19px 20px); border: 1px solid #eadca8; color: #3a2a0a; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; line-height: 20px; white-space: pre; overflow-x: auto; box-shadow: 3px 3px 0 rgba(90,60,30,.1); }
.reading { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.reading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.listado-text { width: 100%; min-height: 260px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; background: #fffbea; }

/* ---------- origen de los datos reales ---------- */
.src-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 0 18px 14px; }
.src-card { padding: 14px 16px; border: 1px solid var(--line-strong); border-top: 4px solid var(--pasture); border-radius: 8px; background: #fffdf6; min-width: 0; }
.src-file { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #e8f0dc; color: var(--pasture); font-size: .68rem; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.src-card h3 { margin: 8px 0 6px; font-family: var(--slab); font-size: 1rem; }
.src-card ul, .src-gaps ul { margin: 0; padding-left: 18px; font-size: .8rem; line-height: 1.55; }
.src-gaps { padding: 12px 16px; border-radius: 8px; background: #fff6df; border-left: 4px solid var(--tag); font-size: .84rem; }
.src-gaps ul { margin-top: 6px; color: var(--muted); }

/* ---------- registro diario: tratamientos, sacos, planta ---------- */
.user-select select { max-width: 190px; }
.timeline li.tx::before { background: var(--red); }
.data-table.compact td, .data-table.compact th { padding: 6px 10px; }
.data-table tfoot td { padding: 9px 12px; border-top: 2px solid var(--line-strong); background: #fbf6ec; }
.warn-box { padding: 10px 12px; border-radius: 6px; background: #fff6df; border-left: 4px solid var(--ochre); color: #8c5f07; font-size: .84rem; font-weight: 650; display: grid; gap: 4px; }
.date-pick { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.date-pick input { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font: inherit; font-size: .86rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.rac-table select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fffefb; max-width: 210px; }
.rac-inp { width: 80px; font-weight: 800; }
.formula-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 0 18px 18px; }
.formula-card { border: 1px solid var(--line-strong); border-top: 4px solid var(--ochre); border-radius: 8px; background: #fffdf6; display: grid; align-content: start; min-width: 0; }
.formula-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 12px 14px 8px; }
.formula-card header strong { display: block; font-family: var(--slab); font-size: 1.02rem; }
.formula-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.trat-rows { display: grid; gap: 4px; margin-top: 10px; }
.trat-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 140px; gap: 12px; align-items: end; }
.trat-unit { padding-bottom: 10px; }
.perm-table th.c, .perm-table td.c { text-align: center; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--pasture); cursor: pointer; }
.perm-table input[type=checkbox]:disabled { cursor: not-allowed; opacity: .6; }
.perm-table tr.off td { opacity: .55; }
.badge-btn { border: 0; cursor: pointer; font: inherit; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 0 18px 18px; }
.area-card { padding: 10px 12px; border-radius: 6px; background: #f8f1e4; border-left: 3px solid var(--wood-600); display: grid; gap: 3px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 6px 0 12px; }
.recorrido { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 0 18px 18px; }
.recorrido button { display: grid; gap: 2px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; cursor: pointer; }
.recorrido button:hover { border-color: var(--wood-600); }
.recorrido b { font-family: var(--slab); color: var(--terra); font-size: 1.1rem; }
.recorrido strong { font-size: .92rem; }
.recorrido span { color: var(--muted); font-size: .75rem; }
.benefit-list { margin: 0; padding: 0 16px 14px 34px; display: grid; gap: 6px; font-size: .86rem; }
.benefit-list li::marker { color: var(--pasture); }
.pager { justify-content: flex-end; }
.check { display: flex; align-items: center; gap: 8px; font-size: .88rem; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 8px; background: var(--wood-950); border-left: 5px solid var(--tag); color: #f4e9d8; box-shadow: var(--shadow); font-size: .86rem; font-weight: 650; max-width: 440px; animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--terra); background: #4a1d12; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

@media (max-width: 1450px) {
  .sede-select span { display: none; }
  .user-select select { max-width: 150px; }
}
@media (max-width: 1250px) {
  .group-tab { padding: 9px 11px 20px; font-size: .9rem; }
  .stamp { display: none; }
  .brand span { display: none; }
}
@media (max-width: 1150px) {
  .rh-top { flex-wrap: wrap; row-gap: 0; }
  .group-tabs { order: 3; flex-basis: 100%; margin-left: 0; }
  .grid-2, .grid-2.even { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kv-grid, .cmd-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .src-grid { grid-template-columns: 1fr; }
  .parte { grid-template-columns: 1fr; }
  .parte-actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 860px) {
  .rh-top { flex-wrap: wrap; padding: 10px 14px 0; gap: 10px; }
  .group-tabs { order: 3; flex-basis: 100%; margin: 0; overflow-x: auto; }
  .group-tab { top: 0; padding: 9px 12px 12px; }
  .brand span { display: none; }
  .sub-tabs, .page-title-row { padding-left: 14px; padding-right: 14px; }
  main { padding: 14px; }
  .form-grid, .form-grid.two, .subgrid, .cmd-grid, .kv-grid { grid-template-columns: 1fr; }
  .demo-strip .txt { display: none; }
  .demo-strip { justify-content: space-between; }
  .sede-select span { display: none; }
  .parte-date { padding-left: 64px; }
}

/* ---------- frente de inicio ---------- */
body.ps4-home .demo-strip,
body.ps4-home .ranch-header,
body.ps4-home .page-title-row,
body.ps4-home main,
body.ps4-home .toast-region { visibility: hidden; }



/* ---------- inicio estilo consola (rediseño) ---------- */
.ps4-home {
  position: fixed; inset: 0; z-index: 80; color: var(--ink);
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-padding: 90px 0 150px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 420px at 92% 105%, rgba(200,138,20,.18), transparent 62%),
    radial-gradient(760px 360px at -5% -10%, rgba(181,84,45,.14), transparent 60%),
    var(--canvas);
}
.ps4-home[hidden] { display: none; }
.ps4-home canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ps4-top, .ps4-stage, .ps4-caption { position: relative; z-index: 1; }
.ps4-top { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(rgba(247,240,228,.94), rgba(247,240,228,.82)); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(74,48,30,.08); }
.ps4-user { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 1rem; font-weight: 700; color: var(--wood-950); }
.ps4-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps4-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, #ffd85a, var(--ochre)); color: var(--wood-950); box-shadow: 0 0 0 3px #fff7e0, 0 4px 10px rgba(52,33,18,.2); font-weight: 800; }
.ps4-clock { flex: 0 0 auto; text-align: right; color: var(--wood-900); }
.ps4-clock strong { display: block; font-family: var(--slab); font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.ps4-clock span { display: block; color: var(--muted); font-size: .8rem; text-transform: capitalize; white-space: nowrap; }
.ps4-stage { flex: 1 0 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px clamp(14px, 4vw, 40px) 24px; box-sizing: border-box; }
.ps4-row-wrap, .ps4-row { display: block; width: 100%; }
.ps4-row { display: grid; gap: 22px 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
.ps4-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-family: var(--slab); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--wood-800); }
.ps4-sec h3 span { width: 10px; height: 10px; border-radius: 3px; background: var(--sec); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sec) 22%, transparent); }
.ps4-sec h3 small { margin-left: auto; font-family: "Segoe UI", system-ui, sans-serif; font-size: .7rem; letter-spacing: 0; color: var(--muted); font-weight: 700; }
.ps4-sec h3::after { content: ""; order: 2; flex: 1; height: 1px; background: rgba(74,48,30,.14); }
.ps4-sec h3 small { order: 3; margin-left: 0; }
.ps4-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.ps4-tile {
  --c1: #6a4630; --c2: var(--wood-900); --fg: #fbf3e6;
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px;
  aspect-ratio: 1 / 1; min-height: 92px; padding: 12px; border: 0; border-radius: 16px; cursor: pointer; text-align: left; color: var(--fg);
  background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.22), transparent 55%), linear-gradient(155deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -2px 0 rgba(0,0,0,.12), 0 6px 14px rgba(52,33,18,.16);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; outline: none;
}
.ps4-tile i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.18); }
.ps4-tile svg { width: 22px; height: 22px; }
.ps4-tile b { font-size: .86rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: normal; word-break: normal; hyphens: manual; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.ps4-tile:hover { transform: translateY(-3px); filter: saturate(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 12px 22px rgba(52,33,18,.22); }
.ps4-tile.on { transform: translateY(-3px) scale(1.04); z-index: 1;
  box-shadow: 0 0 0 3px #fffaf0, 0 0 0 6px var(--wood-950), 0 16px 30px rgba(52,33,18,.32); }
.ps4-tile:focus-visible { box-shadow: 0 0 0 3px #fffaf0, 0 0 0 6px var(--terra), 0 16px 30px rgba(52,33,18,.32); }
.terra { --sec: #c55f33; } .pasture { --sec: #567a39; } .wood { --sec: #5a3b27; } .ochre { --sec: #d9a21c; } .blue { --sec: #4b7894; } .leather { --sec: #8a5a35; }
.ps4-tile.terra { --c1: #db7446; --c2: var(--terra-dark); }
.ps4-tile.pasture { --c1: #779a55; --c2: #3b5426; }
.ps4-tile.wood { --c1: #74503a; --c2: #3a2617; }
.ps4-tile.ochre { --c1: #f6cd45; --c2: #c98a12; --fg: #2b1b0e; }
.ps4-tile.ochre b { text-shadow: none; } .ps4-tile.ochre i { background: rgba(255,255,255,.35); }
.ps4-tile.blue { --c1: #6c9ab3; --c2: #345f78; }
.ps4-tile.leather { --c1: #a06c43; --c2: #5e3c22; }
.ps4-caption { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 4vw, 40px) 14px;
  background: linear-gradient(rgba(250,244,234,.86), rgba(250,244,234,.97)); backdrop-filter: blur(10px); border-top: 1px solid rgba(74,48,30,.1); box-shadow: 0 -8px 24px rgba(52,33,18,.06); }
.ps4-caption-text { flex: 1; min-width: 0; }
.ps4-caption p, .ps4-caption h2 { margin: 0; }
#ps4Kicker { color: var(--terra); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
#ps4Title { margin: 2px 0; font-size: 1.45rem; color: var(--wood-900); }
#ps4Desc { color: var(--muted); font-size: .9rem; }
#ps4Stats { margin-top: 3px; color: var(--terra-dark); font-weight: 800; font-size: .88rem; }
#ps4Stats:empty { display: none; }
.ps4-hints { flex: 0 0 auto; display: flex; gap: 16px; color: var(--wood-800); font-size: .85rem; font-weight: 700; }
.ps4-hints i { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-right: 6px; padding: 0 6px; border-radius: 11px; border: 1.5px solid var(--wood-800); font-style: normal; font-size: .68rem; }
.ps4-hints .psx { background: var(--terra); border-color: var(--terra); color: #fff; }
@media (max-width: 700px) {
  .ps4-clock strong { font-size: 1.15rem; }
  .ps4-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .ps4-tile { min-height: 84px; padding: 10px; border-radius: 14px; }
  .ps4-tile i { width: 32px; height: 32px; } .ps4-tile svg { width: 19px; height: 19px; }
  .ps4-tile b { font-size: .8rem; }
  #ps4Title { font-size: 1.15rem; } #ps4Desc { font-size: .82rem; }
  .ps4-hints { display: none; }
}
@media (max-height: 520px) { .ps4-top { padding-block: 8px; } #ps4Desc { display: none; } .ps4-caption { padding-block: 8px; } }

.ps4-tile b { font-size: clamp(.72rem, 1.05vw, .86rem); }
@media (max-width: 700px) { .ps4-tile b { font-size: .74rem; } }
/* selección múltiple */
.sel-col { width: 34px; text-align: center; }
.sel-col input { width: 18px; height: 18px; accent-color: var(--terra); cursor: pointer; }
tr.is-sel td { background: var(--terra-soft) !important; }
.sel-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 10px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--wood-950); color: #fbf3e6; box-shadow: 0 -6px 20px rgba(36,24,15,.25); }
.sel-bar .sel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sel-bar .button.secondary { background: rgba(255,255,255,.1); color: #fbf3e6; border-color: rgba(255,255,255,.25); }
@media (max-width: 600px) { .sel-bar .sel-actions { width: 100%; } .sel-bar .sel-actions .button { flex: 1 1 auto; } }
.ps4-tile { container-type: inline-size; }
.ps4-tile b { max-width: 100%; font-size: clamp(.62rem, 10.5cqi, .86rem); }
@media (max-width: 700px) { .ps4-tile b { font-size: clamp(.6rem, 10.5cqi, .8rem); } }
.sel-modo { margin: 8px 0; }
.sel-modo label { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.sel-modo input[type=radio] { width: 18px !important; height: 18px; min-height: 0; margin: 0; padding: 0; flex: 0 0 auto; accent-color: var(--terra); box-shadow: none; }
.ps4-tile b { display: block; width: 100%; font-size: var(--lbl, .86rem); white-space: normal; }
.sel-bar { box-sizing: border-box; max-width: calc(100vw - 32px); }
.sel-bar > div { min-width: 0; }
@media (max-width: 600px) { .sel-bar .sel-actions { display: grid; grid-template-columns: 1fr 1fr; } .sel-bar .sel-actions .button[data-action="sel-lote"] { grid-column: 1 / -1; order: -1; } .sel-bar .button { white-space: normal; } }

/* ---------- app en el teléfono (≤700px) ---------- */
.gt-ico { display: none; }
td.m-info { display: none; }
.ps4-top { padding-top: max(14px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.ps4-caption { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .demo-strip { display: none; }
  .ranch-header { top: 0; padding-top: env(safe-area-inset-top); border-bottom-width: 3px; }
  .rh-top { flex-wrap: nowrap; gap: 8px; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  .brand-mark { width: 36px; height: 36px; border-width: 2px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .brand strong { font-size: .98rem; }
  .top-actions { gap: 6px; min-width: 0; }
  .sede-select { padding: 2px; border-radius: 8px; }
  .sede-select select { max-width: 118px; padding: 7px 6px; font-size: .76rem; min-height: 34px; }
  .sub-tabs { padding: 0 8px; gap: 0; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab { padding: 11px 12px 9px; font-size: .84rem; scroll-snap-align: start; }
  /* barra inferior de secciones, como app */
  .group-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; order: initial; margin: 0; flex-basis: auto;
    display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    background: var(--wood-950); border-top: 3px solid var(--terra); box-shadow: 0 -6px 18px rgba(36,24,15,.25); }
  .group-tabs::-webkit-scrollbar { display: none; }
  .group-tab { flex: 1 0 58px; flex-direction: column; gap: 2px; top: 0; padding: 6px 2px 4px; border-radius: 10px; font-family: inherit; font-size: .66rem; font-weight: 800; position: relative; min-height: 52px; justify-content: center; }
  .group-tab .gt-ico { display: grid; place-items: center; font-style: normal; }
  .group-tab.active { background: rgba(242,194,48,.16); color: var(--tag); }
  .group-tab .gcount { position: absolute; top: 2px; right: calc(50% - 22px); height: 16px; min-width: 16px; padding: 0 4px; font-size: .58rem; }
  .page-title-row { padding: 14px 14px 0; flex-wrap: wrap; align-items: center; gap: 10px; }
  .page-heading h1 { font-size: 1.4rem; }
  .page-title-row .button { min-height: 44px; }
  main { padding: 12px 10px 24px; }
  .panel { border-radius: 12px; }
  .button { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
  .toast-region { bottom: calc(76px + env(safe-area-inset-bottom)) !important; left: 10px; right: 10px; }
  /* tabla de alertas: tarjetas con check grande */
  .listo-detail .toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
  .listo-detail .toolbar .raza-picks { display: flex; gap: 6px; overflow-x: auto; flex-wrap: nowrap; width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .listo-detail .toolbar .check-chip { flex: 0 0 auto; min-height: 40px; }
  .listo-detail .toolbar select { flex: 1 1 140px; min-height: 44px; }
  .listo-detail .table-wrap { overflow: visible; }
  .listo-detail table, .listo-detail tbody { display: block; width: 100%; }
  .listo-detail thead { display: block; }
  .listo-detail thead tr { display: flex; align-items: center; padding: 8px 10px; }
  .listo-detail thead th { display: none; }
  .listo-detail thead th.sel-col { display: flex; align-items: center; gap: 10px; width: auto; }
  .listo-detail thead th.sel-col::after { content: "Seleccionar todos los filtrados"; font-size: .78rem; text-transform: none; letter-spacing: 0; color: var(--wood-800); font-weight: 800; }
  .listo-detail tbody tr { display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "chk marca badge" "chk info info"; align-items: center; column-gap: 8px; row-gap: 4px; padding: 10px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
  .listo-detail tbody td { display: block; padding: 0 !important; border: 0 !important; background: transparent !important; text-align: left !important; }
  .listo-detail tbody tr.is-sel { background: var(--terra-soft); }
  .listo-detail tbody td:nth-child(1) { grid-area: chk; display: grid; place-items: center; }
  .listo-detail tbody td:nth-child(2) { grid-area: marca; }
  .listo-detail tbody td:nth-child(3) { display: none; }
  .listo-detail tbody td:nth-child(8) { grid-area: badge; }
  .listo-detail tbody td:nth-child(n+3):nth-child(-n+7) { display: none; }
  .listo-detail tbody td.m-info { grid-area: info; display: block; font-size: .8rem; color: var(--muted); }
  .listo-detail td.empty { grid-column: 1 / -1; }
  .sel-col input { width: 26px; height: 26px; }
  .listo-detail.has-sel { padding-bottom: 140px; }
  .sel-bar { position: fixed; left: 8px; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); max-width: none; margin: 0; z-index: 55; border-radius: 14px; }
  /* modales como hoja inferior */
  dialog, dialog.wide { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog form { max-height: 92dvh; }
  .dialog-head { padding: 14px 16px 12px; }
  .dialog-body { padding: 14px 16px; }
  .dialog-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .dialog-foot .button { flex: 1; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 380px) { .brand strong { display: none; } .sede-select select { max-width: 132px; } }
@media (max-width: 700px) {
  .listo-detail table.data-table { min-width: 0 !important; width: 100% !important; }
  .listo-detail tbody tr { width: auto; min-width: 0; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .listo-detail tbody td { white-space: normal !important; min-width: 0; }
  .listo-detail thead tr { background: transparent; }
  .listo-detail tbody td:nth-child(8) .badge { white-space: nowrap; }
}
@media (max-width: 700px) {
  .alert-block, .alert-item { min-width: 0; max-width: 100%; }
  .alert-item { white-space: normal; text-align: left; }
  .alert-item .ai-main, .alert-item strong, .alert-item small { white-space: normal; min-width: 0; }
  .table-wrap { max-width: 100%; overflow-x: auto; }
  .panel, section, main > * { min-width: 0; max-width: 100%; }
}
@media (max-width: 700px) { .group-tabs { box-sizing: border-box; width: 100%; max-width: 100vw; } .group-tab { flex: 1 1 0; min-width: 0; } }
@media (max-width: 700px) {
  .rh-top { min-width: 0; }
  .brand { flex: 0 1 auto; min-width: 0; }
  .top-actions { flex: 1 1 auto; justify-content: flex-end; }
  .sede-select { min-width: 0; flex: 0 1 auto; }
  .sede-select select { max-width: 100%; width: 100%; }
  .toast-region { right: 10px !important; left: 10px !important; width: auto !important; max-width: none; }
}
@media (max-width: 460px) { .brand strong { display: none; } }
@media (max-width: 700px) { body { padding-top: 0; } }
.dias-range { display: inline-flex; gap: 6px; }
.dias-range input { width: 110px; }
.sub.verif, b.verif { color: #2f7a3e; font-weight: 600; }
.vent-sub td { background: rgba(242, 194, 48, .08); font-size: .92em; }
.verif-table select, .verif-table input { min-height: 40px; font-size: 16px; }
.verif-table input { width: 100px; text-align: right; }
@media (max-width: 700px) {
  .dias-range { width: 100%; } .dias-range input { flex: 1 1 0; width: auto; min-width: 0; }
  .sel-bar .sel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sel-bar .sel-actions [data-action="sel-lote"] { grid-column: 1 / -1; order: -1; }
  .brand { position: relative; z-index: 5; min-width: 44px; min-height: 44px; touch-action: manipulation; }
}
@media (max-width: 700px) { .sel-bar .sel-actions [data-action="sel-envio"] { grid-column: 1 / -1; } }
/* ---------- envío vs venta final, reparto, consulta de reses ---------- */
.step-strip { display: flex; gap: 6px; margin: 4px 0 12px; }
.step-strip span { flex: 1; padding: 7px 10px; border-radius: 6px; background: var(--wood-100); color: var(--muted); font-weight: 700; font-size: .8rem; text-align: center; }
.step-strip span.on { background: var(--wood-900); color: var(--tag); }
.venta-hero { border-top: 4px solid var(--pasture); }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-row input { flex: 1 1 120px; min-width: 110px; }
.ps-in.est { background: var(--ochre-soft); border-color: var(--ochre); font-style: italic; }
.ps-in.real { background: var(--pasture-soft); border-color: var(--pasture); font-weight: 700; }
.peso-salida .ps-tag { display: block; font-size: .68rem; }
.reparto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reparto label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.total-row td { border-top: 2px solid var(--line-strong); background: var(--wood-100); }
.res-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.res-hero .res-corral { grid-column: 1 / -1; }
.res-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; }
.res-num span { width: 100%; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.res-num strong { font-family: var(--slab); font-size: 2.6rem; line-height: 1; font-weight: 900; }
.res-num em { font-style: normal; font-weight: 800; font-size: 1.1rem; padding: 3px 10px; border-radius: 999px; background: var(--wood-100); }
.res-hero > div { border-radius: 8px; padding: 10px 12px; background: var(--wood-100); display: flex; flex-direction: column; }
.res-hero span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.res-hero strong { font-family: var(--slab); font-size: 1.5rem; line-height: 1.15; }
.res-hero small { color: var(--muted); font-size: .74rem; }
.res-hero .res-corral { background: var(--wood-900); color: #f4e9d8; }
.res-hero .res-corral span, .res-hero .res-corral small { color: var(--tag); }
.res-hero .res-corral strong { font-size: 2rem; color: #fff; }
@media (max-width: 900px) { .res-hero { grid-template-columns: 1fr 1fr; } .res-hero .res-corral { grid-column: 1 / -1; } }
@media (max-width: 560px) { .res-hero { grid-template-columns: 1fr 1fr; } .res-hero .res-corral { grid-column: 1 / -1; } .reparto { grid-template-columns: 1fr; } }
.row-actions { white-space: nowrap; }
.ref-tabla tr.ref-dudosa td { background: #fff3c4; }

/* v20 fechas DD/MM/AA */
.fecha-wrap{position:relative;display:flex;align-items:center;gap:6px;width:100%}
.fecha-wrap>input.inp-fecha{flex:1;min-width:0}
.fecha-cal{border:1px solid var(--line,#d9cbb5);background:transparent;border-radius:8px;padding:6px 8px;cursor:pointer;font-size:16px;line-height:1}
/* v28 orden de beneficio */
.ob-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: var(--paper-2, #f7f0e4); border: 1px solid rgba(120, 80, 40, .18); }
.ob-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.warn-txt { color: #a24a1a; font-weight: 600; }

.pz-table tr.pz-1 td{border-top:2px solid rgba(0,0,0,.12)}
.badge.bad{background:#fde2e1;color:#a4282a}
/* v49: Reporte de saldos — lista completa con encabezado fijo */
.saldos-scroll { max-height: 75vh; overflow: auto; }
.saldos-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--wood-100); box-shadow: 0 1px 0 rgba(0,0,0,.08); }

/* v51: casilla con etiqueta alineada */
.check-row{display:flex!important;flex-direction:row!important;align-items:center;gap:10px;cursor:pointer;text-transform:none;letter-spacing:0;font-size:14px;font-weight:500}
.check-row input[type=checkbox]{width:20px;height:20px;flex:none;margin:0}
.solo-costo .hint{margin-left:30px}

/* v52 multi-producto medicinas */
.mm-row{display:grid;grid-template-columns:1fr 90px auto auto;gap:8px;align-items:center;margin-top:6px}
.mm-row .mm-st{font-size:12px;white-space:nowrap}
@media(max-width:560px){.mm-row{grid-template-columns:1fr 80px auto}.mm-row .mm-st{grid-column:1/-1;order:5}}
tr.row-bad td{background:#fff1ef}
.badge.bad{background:#fde2df;color:#b42318}
.cmd-actions .button:disabled{opacity:.45;cursor:not-allowed}
/* v62: saldos · razas múltiples y casillas */
.saldo-razas { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.saldo-bar { flex-wrap: wrap; gap: 8px; align-items: center; }
.saldo-all { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.saldos-panel .sel-col { width: 34px; text-align: center; }
.saldos-panel .sel-col input { width: 18px; height: 18px; }
.ps-in.duda { outline: 2px solid #d9a400; }
/* v64: botón PDF arriba a la derecha del Reporte de saldos */
.saldo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.saldo-pdf-btn { white-space: nowrap; font-weight: 700; }
@media (max-width: 420px) { .saldo-pdf-btn { font-size: 13px; padding: 8px 10px; } }

/* v66: «Finca nueva» — 6 tarjetas grandes (una por sección) y sección desplegada con volver/cerrar. */
.ps4-row > .ps4-finca, .ps4-row > .ps4-crumb, .ps4-row > .ps4-open { grid-column: 1 / -1; }
.ps4-finca-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; font-family: var(--slab); font-size: clamp(1.25rem, 2.6vw, 1.7rem); letter-spacing: .16em; text-transform: uppercase; color: var(--wood-950); }
.ps4-finca-title span { width: 14px; height: 14px; border-radius: 4px; background: var(--terra); box-shadow: 0 0 0 4px color-mix(in srgb, var(--terra) 22%, transparent); }
.ps4-finca-title::after { content: ""; order: 2; flex: 1; height: 2px; background: rgba(74,48,30,.16); }
.ps4-finca-title small { order: 3; font-family: "Segoe UI", system-ui, sans-serif; font-size: .78rem; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 700; }
.ps4-cards { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ps4-tile.ps4-card { aspect-ratio: auto; min-height: 168px; padding: 18px 18px 16px; border-radius: 22px; justify-content: flex-end; gap: 6px; }
.ps4-card i { position: absolute; top: 16px; left: 16px; width: 54px; height: 54px; border-radius: 15px; }
.ps4-card i svg { width: 30px; height: 30px; }
.ps4-tile.ps4-card b { font-family: var(--slab); font-size: clamp(1.05rem, 2vw, 1.35rem); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps4-card small { font-size: .85rem; font-weight: 700; opacity: .9; }
.ps4-card .ps4-alert { position: absolute; top: 14px; right: 14px; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: grid; place-items: center; box-sizing: border-box; background: #fffaf0; color: var(--terra-dark); font-style: normal; font-weight: 800; font-size: .8rem; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.ps4-crumb { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; }
.ps4-back, .ps4-close { border: 0; cursor: pointer; font: inherit; font-weight: 800; color: var(--wood-950); background: #fffaf0; box-shadow: 0 0 0 1.5px rgba(74,48,30,.22), 0 4px 10px rgba(52,33,18,.12); }
.ps4-back { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; font-size: .95rem; }
.ps4-close { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; }
.ps4-back:hover, .ps4-close:hover { background: #fff; }
.ps4-back:focus-visible, .ps4-close:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
.ps4-crumb-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--slab); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ps4-crumb-path b { color: var(--wood-950); } .ps4-crumb-path i { font-style: normal; margin: 0 4px; }
.ps4-open .ps4-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.ps4-open { animation: ps4-in .22s ease; }
@keyframes ps4-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#ps4HintBack[hidden] { display: none; }
@media (max-width: 900px) { .ps4-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (max-width: 700px) {
  .ps4-tile.ps4-card { min-height: 132px; padding: 14px; border-radius: 18px; }
  .ps4-card i { top: 12px; left: 12px; width: 44px; height: 44px; } .ps4-card i svg { width: 24px; height: 24px; }
  .ps4-tile.ps4-card b { font-size: 1rem; letter-spacing: .06em; }
  .ps4-card small { font-size: .76rem; }
  .ps4-open .ps4-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
  .ps4-crumb-path { font-size: .72rem; }
}
@media (prefers-reduced-motion: reduce) { .ps4-open { animation: none; } }

/* v67: una sola fila deslizable estilo PS4 (inicio y sección abierta). */
.ps4-strip { display: flex !important; flex-wrap: nowrap; gap: 18px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  padding: 30px max(24px, calc(50% - 130px)) 44px; margin: 0 calc(-1 * clamp(14px, 4vw, 40px)); scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; touch-action: pan-x pan-y; }
.ps4-strip::-webkit-scrollbar { display: none; }
.ps4-strip.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.ps4-strip.dragging .ps4-tile { pointer-events: none; }
.ps4-strip > .ps4-tile { flex: 0 0 auto; scroll-snap-align: center; transform: scale(.88); opacity: .78; filter: saturate(.85);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .25s, filter .25s, box-shadow .25s; }
.ps4-strip > .ps4-tile.on, .ps4-strip > .ps4-tile:focus-visible { transform: scale(1.08); opacity: 1; filter: none; z-index: 2; }
.ps4-strip > .ps4-tile:hover:not(.on) { transform: scale(.92); }
.ps4-cards.ps4-strip > .ps4-card { width: 240px; min-height: 200px; }
.ps4-open .ps4-grid.ps4-strip { padding-inline: max(24px, calc(50% - 75px)); gap: 14px; }
.ps4-open .ps4-strip > .ps4-tile { width: 150px; aspect-ratio: 1 / 1; min-height: 0; }
.ps4-finca, .ps4-open { overflow: visible; }
@media (max-width: 700px) {
  .ps4-strip { gap: 12px; padding: 20px max(16px, calc(50% - 90px)); }
  .ps4-cards.ps4-strip > .ps4-card { width: 180px; min-height: 170px; }
  .ps4-open .ps4-grid.ps4-strip { padding-inline: max(16px, calc(50% - 60px)); gap: 10px; }
  .ps4-open .ps4-strip > .ps4-tile { width: 120px; }
}
@media (prefers-reduced-motion: reduce) { .ps4-strip { scroll-behavior: auto; } .ps4-strip > .ps4-tile { transition: none; } }

/* v68: en móvil la tabla de peso de salida entra completa (sin columna Corral) y el kg de hoja se marca. */
@media (max-width: 600px) {
  table.peso-salida th:nth-child(2), table.peso-salida td:nth-child(2) { display: none; }
  table.peso-salida { min-width: 0 !important; width: 100%; }
  table.peso-salida th, table.peso-salida td { padding-left: 6px; padding-right: 6px; }
  table.peso-salida .ps-in { width: 84px; }
  table.peso-salida .ps-tag { white-space: normal; max-width: 120px; margin-left: auto; }
}
table.peso-salida .ps-in.real + .ps-tag { color: var(--pasture, #4f6b3a); font-weight: 600; }

/* v70: columna de identificación fija al deslizar a la derecha (Reporte de saldos: casilla + Espalda). */
.table-wrap:has(> .sticky-id) { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sticky-id { --sid-bg: #fffdf8; --sid-sel: 44px; }
.sticky-id > tbody > tr > td:first-child, .sticky-id > thead > tr > th:first-child,
.sticky-sel > tbody > tr > td:nth-child(2), .sticky-sel > thead > tr > th:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--sid-bg); }
.sticky-sel > tbody > tr > td:nth-child(2), .sticky-sel > thead > tr > th:nth-child(2) { left: var(--sid-sel); }
.sticky-sel .sel-col { width: var(--sid-sel); min-width: var(--sid-sel); max-width: var(--sid-sel); padding-left: 0; padding-right: 0; box-sizing: border-box; }
.sticky-id > tbody > tr:nth-child(even) > td { --sid-bg: #fcf8f0; }
.sticky-id > tbody > tr:hover > td { --sid-bg: var(--ochre-soft); }
.sticky-id > tbody > tr.is-sel > td, .sticky-id > tbody > tr.hl > td { --sid-bg: var(--terra-soft); }
.sticky-id > thead > tr > th { --sid-bg: var(--wood-100); }
.sticky-id > thead > tr > th:first-child, .sticky-sel > thead > tr > th:nth-child(2) { z-index: 3; }
.sticky-id:not(.sticky-sel) > * > tr > :first-child, .sticky-sel > * > tr > :nth-child(2) { box-shadow: 6px 0 6px -4px rgba(36, 24, 15, .22); clip-path: inset(0 -12px 0 0); }
.sticky-id .marca-cell, .sticky-id td:nth-child(2) .pill { white-space: nowrap; }
/* v70: Reporte de saldos compacto (encabezados cortos, columnas ajustadas al contenido). */
.saldos-tabla { width: auto; min-width: 0; }
.saldos-tabla th, .saldos-tabla td { padding: 6px 8px; }
.saldos-tabla th { font-size: .62rem; letter-spacing: .04em; }
.saldos-tabla td { font-size: .8rem; }
.saldos-tabla td .sub { font-size: .68rem; }
.saldos-tabla td.num { font-variant-numeric: tabular-nums; }
