*, *::before, *::after { box-sizing: border-box; }

/* ── Pampa design tokens ────────────────────────────────── */
:root {
  --pine:   #1F5A43;
  --gold:   #CC9A22;
  --rust:   #B5562E;
  --moss:   #5E7444;
  --teal:   #246B6E;
  --panel:  #FBFBF8;
  --muted:  #6A746C;
  --line:   #DDE0D7;
  --sidebar:#131B16;
  --f-display: 'Space Grotesk', sans-serif;
  --f-ui:      'Spline Sans', sans-serif;
  --f-mono:    'Inter', sans-serif;

  /* Shared tokens (migrated from sistema-b) */
  --bg:    #F0EDE6;
  --ink:   #1a1a18;
  --ink-2: #3a3833;

  /* Structural tokens — mirror current values; change here on next redesign */
  --radius-card: 0;
  --radius-btn:  0;
  --radius-pill: 3px;
  --shadow-card: none;
  --card-pad:    16px 20px;
}

html { background: var(--bg); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ── Toast ──────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border-radius: 0;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.22);
  opacity: 1;
  transition: opacity .3s ease;
  pointer-events: auto;
  border-left: 3px solid rgba(255,255,255,0.35);
}
.toast-success { background: #1F5A43; }
.toast-error   { background: #B5562E; }
.toast-warning { background: #9A7210; color: #FDF8ED; }
.toast-info    { background: #246B6E; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Scrollbar fino 4px — columnas de meses en Entregas */
.ent-meses::-webkit-scrollbar { width: 4px; }
.ent-meses::-webkit-scrollbar-track { background: transparent; }
.ent-meses::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.ent-meses::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* ── Table alternating + hover ──────────────────────── */
.recon-table tbody tr:hover { filter: brightness(.97); }


/* ── Fade-in ────────────────────────────────────────── */
.fade-in {
  animation: fadeIn .15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}


.ent-row:hover td { box-shadow: inset 0 0 0 9999px rgba(0,0,0,0.10); }

/* ── Pampa Sidebar ──────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid #1A2620;
  display: flex;
  flex-direction: column;
  color: #C5CEC4;
}
/* Sidebar structural */
.sb-top {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  position: relative;
}
.sb-item .chev { margin-left: auto; opacity: 0.5; font-size: 11px; }
.sb-bottom {
  background: rgba(0,0,0,0.2);
  padding: 7px 11px 9px;
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid #0c1620;
}
.sb-bottom-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.sb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  font-size: 11px;
  flex: 1;
  min-width: 0;
}
.sb-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.sb-collapse {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
}
.sb-sub {
  display: flex;
  flex-direction: column;
  margin: 2px 0 6px 8px;
  padding-left: 12px;
  border-left: 1px solid #2a3744;
}
.sb-sub .sb-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: default;
}
.sb-sub .sb-subitem .pill { margin-left: auto; }
/* Sidebar Pampa color overrides */
.sidebar .sb-item {
  padding: 8px 22px;
  gap: 13px;
  font-size: 12.5px;
  color: #C5CEC4;
  border-radius: 0;
}
.sidebar .sb-item svg {
  color: #8FA092;
  opacity: 1;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar .sb-item:not(.active):hover {
  background: rgba(255,255,255,0.04);
  color: #E8EBE4;
}
.sidebar .sb-item.active {
  background: #1B2A21;
  color: #F4F0E2;
  font-weight: 600;
  padding: 8px 22px 8px 19px;
  border-left: 3px solid var(--gold);
}
.sidebar .sb-item.active::before { display: none; }
.sidebar .sb-item.active svg {
  color: var(--gold);
  stroke-width: 2;
}
.sidebar .sb-item .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background: #25312A;
  color: #9ABFA0;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 700;
  border-radius: 2px;
  min-width: 18px;
  padding: 1px 6px;
  height: auto;
  flex-shrink: 0;
}
.sidebar .sb-item .pill.amber {
  background: var(--gold);
  color: #131B16;
}
.sidebar .sb-sub { border-left-color: #2C3A30; }
.sidebar .sb-sub .sb-subitem { color: #7A8A7C; }
.sidebar .sb-sub .sb-subitem:hover { background: rgba(255,255,255,0.04); color: #C5CEC4; }
.sidebar .sb-sub .sb-subitem.active { background: #1B2A21; color: #E8EBE4; }
.sidebar .sb-search {
  background: transparent;
  border: 1px solid #2C3A30;
  border-radius: 0;
  color: #5E6E62;
}
.sidebar .sb-search svg { color: #5E6E62; }
.sidebar .sb-search input::placeholder { color: #3E5040; }
.sidebar .sb-collapse {
  background: transparent;
  border: 1px solid #2C3A30;
  border-radius: 0;
  color: #5E6E62;
}

/* ── Main content area ──────────────────────────────────── */
.main { flex: 1; overflow-y: auto; padding: 14px 28px 16px; min-width: 0; background: var(--bg); }

/* ── Card system ────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--pine);
  border-radius: 0;
  padding: 16px 18px 14px;
}
.card::before { display: none; }
.card.no-stripe { border-top: 1px solid var(--line); }
.card.muted { background: var(--panel); }
.card.filled { background: var(--pine); color: var(--panel); }
.card.filled::before { display: none; }

/* Card stripe color variants */
.c-contratos { border-top-color: #4a6437; }
.c-entregas  { border-top-color: #e0a234; }
.c-analytics { border-top-color: #6b8a4e; }
.c-concilia  { border-top-color: #2563a8; }
.c-codex     { border-top-color: #8a4520; }
.c-ocre      { border-top-color: #b7841f; }
.c-neutral   { border-top-color: #c8c4ba; }
.c-error     { border-top-color: var(--rust); }

/* Grain stripe variants */
.c-grano-cebada         { border-top-color: #8a4520; }
.c-grano-trigo          { border-top-color: #854d0e; }
.c-grano-maiz           { border-top-color: #e0a234; }
.c-grano-soja           { border-top-color: #4a6437; }
.c-grano-girasol        { border-top-color: #9a3412; }
.c-grano-girasol-oleico { border-top-color: #166534; }
.c-grano-sorgo          { border-top-color: #5b21b6; }
.c-grano-avena          { border-top-color: #475569; }
.c-grano-alpiste        { border-top-color: #374151; }

/* Card head */
.ch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ch .eb { font-family: var(--f-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ch h3 { font-family: var(--f-display); font-size: 15px; font-weight: 700; margin: 1px 0 0; letter-spacing: -0.01em; color: var(--ink); }
.ch .link { font-family: var(--f-mono); font-size: 10px; font-weight: 600; color: var(--pine); text-transform: uppercase; letter-spacing: 0.6px; cursor: pointer; }

/* ── Analytics · Layout ─────────────────────────────────── */
.row1 { display: grid; grid-template-columns: 1.55fr 0.95fr 0.95fr; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.row2 { display: grid; grid-template-columns: 2.1fr 1fr; gap: 14px; margin-bottom: 14px; }
.row3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
.col-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-stack > .card { flex: 1; }
.row1 .card, .row2 .card, .row3 .card { padding: 10px 14px 10px; }

/* Analytics grain table */
.grains { display: flex; flex-direction: column; }
.gh {
  display: grid; grid-template-columns: 86px 1fr 60px 80px 80px 80px;
  gap: 12px; align-items: center; padding: 4px 0 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.gh span:nth-child(3), .gh span:nth-child(4), .gh span:nth-child(5), .gh span:nth-child(6) { text-align: right; font-family: inherit; }
.gr {
  display: grid; grid-template-columns: 86px 1fr 60px 80px 80px 80px;
  gap: 12px; align-items: center; padding: 6px 0;
  border-bottom: 1px solid rgba(221,224,215,0.5);
}
.gr:last-child { border-bottom: none; }
.gr .name { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 2px; font-size: 10.5px; font-weight: 700; width: fit-content; font-family: var(--f-mono); letter-spacing: .02em; }
.gr .bar { height: 6px; border-radius: 999px; background: rgba(22,32,26,0.05); position: relative; overflow: hidden; }
.gr .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pine); border-radius: 999px 0 0 999px; }
.gr .bar i.full { border-radius: 999px; }
.gr .pct { font-family: var(--f-mono); font-weight: 700; font-size: 13px; text-align: right; color: var(--ink); }
.gr .num { font-family: var(--f-mono); font-weight: 600; font-size: 11px; text-align: right; color: var(--muted); }
.gr .num.pact { color: var(--ink); }
.gr .num.pend { color: var(--rust); }
.gr.done .pct { color: var(--pine); }

/* Analytics liquidaciones donut */
.liq { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.donut { position: relative; width: 72px; height: 72px; }
.donut .ct { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .ct .n { font-family: var(--f-mono); font-weight: 700; font-size: 16px; letter-spacing: -0.5px; color: var(--pine); line-height: 1; }
.donut .ct .l { font-size: 7.5px; font-weight: 700; letter-spacing: 1px; color: var(--muted); margin-top: 2px; }
.liq-list { display: flex; flex-direction: column; gap: 7px; }
.liq-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.liq-row .d { width: 8px; height: 8px; border-radius: 50%; }
.liq-row .lbl { color: var(--ink-2); }
.liq-row .n { font-family: var(--f-mono); font-weight: 700; color: var(--ink); }

/* Analytics entregas mensuales */
.ent-stats { display: flex; flex-direction: column; gap: 3px; margin-top: auto; padding-top: 8px; }
.ent-stat { display: flex; align-items: baseline; gap: 8px; }
.ent-stat .l { font-size: 9.5px; font-weight: 700; letter-spacing: 0.9px; text-transform: uppercase; color: var(--muted); min-width: 58px; }
.ent-stat .v { font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: -0.3px; color: var(--ink); }
.ent-stat .v .u { font-size: 10px; color: var(--muted); font-family: var(--f-ui); font-weight: 500; margin-left: 1px; }
.ent-stat .s { font-size: 10px; color: var(--muted); }
.ent-stat.peak .v { color: var(--pine); }

/* Analytics precios */
.precio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.precio { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 8px 10px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.precio .name { font-size: 11px; font-weight: 600; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.precio .name .cur { font-size: 9px; font-weight: 600; color: var(--muted); padding: 1px 4px; background: #F0F1EC; border-radius: 0; }
.precio .val { font-family: var(--f-display); font-weight: 700; font-size: 17px; letter-spacing: -0.5px; color: var(--ink); margin-top: 1px; }
.precio .meta { font-size: 9px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.precio.usd .val { color: #2563a8; }
.precio-section + .precio-section { margin-top: 10px; }
.precio-section .ph { font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* Analytics pendientes */
.pend-big { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; }
.pend-big .n { font-family: var(--f-mono); font-weight: 700; font-size: 36px; letter-spacing: -1.5px; color: var(--rust); line-height: 1; }
.pend-big .l { font-size: 11px; color: var(--muted); }
.pend-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pend-tag { font-family: var(--f-mono); font-size: 10px; padding: 2px 8px; border-radius: 0; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.pend-tag b { font-family: var(--f-mono); font-weight: 700; color: var(--ink); }
.pend-stat { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; }

/* Analytics ranked lists */
.lst { display: flex; flex-direction: column; gap: 7px; }
.li { display: grid; grid-template-columns: 20px 1fr 70px 36px; gap: 10px; align-items: center; padding: 4px 0; }
.li.with-pct { grid-template-columns: 20px 1fr 60px 40px; }
.li .rk { font-family: var(--f-mono); font-size: 11px; font-weight: 700; color: var(--muted); width: 20px; height: 20px; border-radius: 0; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.li .nm { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink); min-width: 0; }
.li .nm .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .nm .barw { height: 4px; border-radius: 0; background: var(--line); position: relative; overflow: hidden; }
.li .nm .barw i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pine); border-radius: 0; }
.li .v { font-family: var(--f-mono); font-weight: 700; font-size: 12px; color: var(--ink); text-align: right; }
.li .ct { font-family: var(--f-mono); font-size: 10px; color: var(--muted); text-align: right; }
.li .pct { font-family: var(--f-mono); font-size: 10px; color: var(--muted); text-align: right; font-weight: 600; }

/* Analytics liq por grano */
.lpg-row { display: grid; grid-template-columns: 88px 1fr 28px; gap: 10px; align-items: center; padding: 4px 0; }
.lpg-row .nm { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 0; font-size: 11px; font-weight: 600; width: fit-content; }
.lpg-row .ct { font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; }
.seg-bar { height: 6px; border-radius: 0; background: var(--line); overflow: hidden; flex: 1; display: flex; }
.seg-bar i.ok { background: var(--pine); }
.seg-bar i.pr { background: var(--gold); }
.seg-bar i.pe { background: var(--rust); }
.lpg-legend { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.lg { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.lg .d { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.lg .d.ok { background: var(--pine); }
.lg .d.pr { background: var(--gold); }
.lg .d.pe { background: var(--rust); }

/* Analytics entregas (planta rows) */
.planta-row { display: grid; grid-template-columns: 100px 1fr 84px 56px; gap: 12px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.planta-row:last-child { border-bottom: none; }
.planta-row .pname { font-size: 12px; font-weight: 600; color: var(--ink); }
.planta-row .pbar { height: 5px; border-radius: 0; background: rgba(22,32,26,0.08); position: relative; overflow: hidden; }
.planta-row .pbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pine); border-radius: 0; }
.planta-row .pkg { font-weight: 700; font-size: 12px; color: var(--ink); text-align: right; }
.planta-row .pkg .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 10px; margin-left: 2px; }
.planta-row .pcam { font-weight: 600; font-size: 11px; color: var(--muted); text-align: right; }
.planta-row .table-h { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }

.hum-row { display: grid; grid-template-columns: 20px 1fr 60px 60px; gap: 10px; align-items: center; padding: 5px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.hum-row:hover { background: #F0F1EC; }
.hum-row .chev { font-size: 12px; color: var(--muted); }
.hum-row .cname { font-family: var(--f-display); font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--ink); text-transform: uppercase; }
.hum-row .hum { font-weight: 700; font-size: 12px; text-align: right; color: var(--ink); }
.hum-row .hum.high { color: var(--rust); }
.hum-row .hum.mid { color: var(--gold); }
.hum-row .hum.low { color: var(--pine); }
.hum-row .cam { font-weight: 600; font-size: 11px; text-align: right; color: var(--muted); }
.hum-row .header { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.hum-row.head { padding-bottom: 5px; border-bottom: 1px solid var(--line); cursor: default; }
.hum-row.head:hover { background: transparent; }

.ritmo { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 52px; }
.ritmo .day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ritmo .bar { width: 100%; max-width: 32px; background: #d6cdb8; border-radius: 0; position: relative; }
.ritmo .bar.peak { background: #2a2a28; }
.ritmo .bar.med { background: #caa14b; }
.ritmo .bar .v { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 9.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ritmo .day .l { font-size: 9.5px; font-weight: 700; letter-spacing: 0.7px; color: var(--muted); text-transform: uppercase; }
.ritmo .day .l.peak { color: var(--ink); }

.dif-row { display: grid; grid-template-columns: 1fr 56px 36px; gap: 10px; align-items: center; padding: 4px 0; font-size: 12px; }
.dif-row .nm { color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.dif-row .nm .dot { width: 6px; height: 6px; border-radius: 0; background: var(--gold); }
.dif-row .nm .dot.red { background: var(--rust); }
.dif-row .v { font-weight: 700; font-size: 12.5px; text-align: right; color: var(--rust); }
.dif-row .v.warn { color: var(--gold); }
.dif-row .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 10.5px; text-align: left; }

.hs-row { display: grid; grid-template-columns: 1fr 60px 90px; gap: 10px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.hs-row:last-child { border-bottom: none; }
.hs-row.head { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.hs-row .plant { color: var(--ink); font-weight: 600; }
.hs-row .pct { font-weight: 700; text-align: right; color: var(--ink); }
.hs-row .pct.high { color: var(--rust); }
.hs-row .pct.mid { color: var(--gold); }
.hs-row .pct.zero { color: var(--muted); }
.hs-row .stack { display: flex; align-items: center; gap: 5px; }
.hs-row .stack .sb { flex: 1; height: 5px; border-radius: 0; background: rgba(22,32,26,0.08); overflow: hidden; display: flex; }
.hs-row .stack .sb .h { background: var(--rust); }
.hs-row .stack .sb .s { background: var(--pine); }
.hs-row .stack .nums { font-size: 10px; color: var(--muted); }

.merma-row { display: grid; grid-template-columns: 22px 1fr 80px; gap: 10px; align-items: center; height: 32px; border-bottom: 1px solid var(--line); overflow: hidden; }
.merma-row:last-child { border-bottom: none; }
.merma-row .rk { width: 16px; height: 16px; border-radius: 0; background: rgba(138,69,32,0.1); color: var(--rust); font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.merma-row .info { font-size: 12px; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; flex-wrap: nowrap; }
.merma-row .info .gr { font-weight: 700; color: var(--ink); font-size: 11px; letter-spacing: 0.2px; text-transform: uppercase; white-space: nowrap; }
.merma-row .info .pl { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.merma-row .kg { font-weight: 700; font-size: 12px; text-align: right; color: var(--rust); }
.merma-row .kg .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 10px; margin-left: 2px; }

.trans-row { display: grid; grid-template-columns: 22px 1fr 80px 36px; gap: 10px; align-items: center; height: 36px; border-bottom: 1px solid var(--line); font-size: 11px; overflow: hidden; }
.trans-row:last-child { border-bottom: none; }
.trans-row .rk { width: 16px; height: 16px; border-radius: 0; background: rgba(74,100,55,0.1); color: var(--pine); font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.trans-row .nm { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trans-row .v { font-weight: 700; font-size: 12px; text-align: right; color: var(--ink); }
.trans-row .v .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 10px; margin-left: 2px; }
.trans-row .ct { font-weight: 600; color: var(--muted); font-size: 11px; text-align: right; }

/* Analytics ventas 2 */
.v2-row { display: grid; grid-template-columns: 100px 60px 1fr 1fr 80px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.v2-row:last-child { border-bottom: none; }
.v2-row.head { padding: 4px 0 8px; border-bottom: 1px solid var(--line); font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.v2-row.head span { text-align: right; }
.v2-row.head span:first-child { text-align: left; }
.v2-row .gname { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 0; font-size: 11px; font-weight: 600; width: fit-content; letter-spacing: 0.3px; }
.v2-row .op    { font-weight: 600; font-size: 11.5px; color: var(--muted); text-align: right; }
.v2-row .precio { display: inline; padding: 0; background: none; border: none; font-weight: 700; font-size: 12.5px; color: var(--ink); text-align: right; }
.v2-row .precio .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 9.5px; margin-right: 3px; }
.v2-row .promtn { font-weight: 600; font-size: 12px; color: var(--ink); text-align: right; }
.v2-row .promtn .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 9.5px; margin-left: 2px; }
.v2-row .total  { font-weight: 700; font-size: 12.5px; color: var(--pine); text-align: right; }
.v2-row .total .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 9.5px; margin-left: 2px; }

.cuenta-row { display: grid; grid-template-columns: 22px 90px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cuenta-row:last-child { border-bottom: none; }
.cuenta-row .rk { width: 20px; height: 20px; border-radius: 0; background: rgba(74,100,55,0.1); color: var(--pine); font-weight: 700; font-size: 10.5px; display: flex; align-items: center; justify-content: center; }
.cuenta-row.top .rk { background: var(--pine); color: #fff; }
.cuenta-row .code { font-weight: 700; font-size: 13px; color: var(--ink); letter-spacing: 0.5px; }
.cuenta-row .bar { height: 5px; border-radius: 0; background: rgba(22,32,26,0.08); position: relative; overflow: hidden; }
.cuenta-row .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pine); border-radius: 0; }
.cuenta-row .meta { font-size: 10.5px; color: var(--muted); text-align: right; line-height: 1.3; }
.cuenta-row .meta .v { font-weight: 700; font-size: 12.5px; color: var(--ink); display: block; }
.cuenta-row .meta .v .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 9.5px; margin-left: 2px; }

.heatmap { width: 100%; border-collapse: collapse; }
.heatmap th, .heatmap td { padding: 9px 10px; text-align: right; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.heatmap th { font-family: var(--f-ui); font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.heatmap th:first-child, .heatmap td:first-child { text-align: left; }
.heatmap td:first-child { font-family: var(--f-display); font-weight: 700; font-size: 12px; color: var(--ink); letter-spacing: 0.3px; text-transform: uppercase; }
.heatmap tbody tr { border-bottom: 1px solid var(--line); }
.heatmap tbody tr:hover td { background: #F0F1EC; }
.heatmap td.zero { color: var(--muted); font-weight: 400; }
.heatmap td.heat-1 { background: rgba(107,138,78,0.08); }
.heatmap td.heat-2 { background: rgba(107,138,78,0.18); }
.heatmap td.heat-3 { background: rgba(107,138,78,0.32); color: var(--pine); font-weight: 700; }
.heatmap td.heat-4 { background: rgba(107,138,78,0.52); color: #fff; font-weight: 800; }
.heatmap .plant-total { background: var(--panel); border-top: 1px solid var(--line) !important; }
.heatmap .plant-total td { font-weight: 800; color: var(--ink); font-size: 12px; }

.conc-card { padding: 18px 20px 16px; }
.conc-big { font-family: var(--f-display); font-weight: 800; font-size: 56px; letter-spacing: -3px; line-height: 1; color: var(--pine); }
.conc-big .u { font-family: var(--f-display); font-size: 24px; letter-spacing: -1px; }
.conc-lbl { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.conc-lbl b { color: var(--ink); font-weight: 700; }
.conc-mini { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.conc-mini .r { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: var(--muted); }
.conc-mini .r b { font-weight: 700; color: var(--ink); font-size: 12px; }

/* Analytics pane overrides */
[data-pane="ventas"].main { padding: 8px 28px 8px; }
[data-pane="ventas"] .row1 { margin-bottom: 8px; grid-template-columns: 1.4fr 1fr; }
[data-pane="ventas"] .card { padding: 7px 14px 7px; }
[data-pane="ventas"] .ch { margin-bottom: 4px; }
[data-pane="ventas"] .v2-row { padding: 2px 0; }
[data-pane="ventas"] .v2-row.head { padding: 2px 0 4px; }
[data-pane="ventas"] .cuenta-row { padding: 2px 0; }
[data-pane="ventas"] .heatmap th, [data-pane="ventas"] .heatmap td { padding: 3px 8px; font-size: 11px; }
[data-pane="ventas"] .heatmap th { padding-bottom: 4px; }

[data-pane="transp"].main { padding: 9px 28px 9px; }
[data-pane="transp"] .filt-bar { margin-bottom: 9px; }
[data-pane="transp"] .row2 { gap: 11px; margin-bottom: 11px; }
[data-pane="transp"] .card { padding: 11px 15px 11px; }
[data-pane="transp"] .ch { margin-bottom: 7px; }
[data-pane="transp"] .ranking-row { padding: 4px 0; }
[data-pane="transp"] .bdx-row { padding: 4px 0; }
[data-pane="transp"] .chof-row { padding: 4px 0; }
[data-pane="transp"] .chof-split-grid { gap: 15px; }
[data-pane="transp"] .col-h { margin-bottom: 5px; padding-bottom: 5px; }

[data-pane="prod"].main { padding: 10px 28px 10px; display: flex; flex-direction: column; overflow: hidden; }
[data-pane="prod"] .card { padding: 10px 14px 10px; display: flex; flex-direction: column; height: 100%; box-sizing: border-box; overflow: hidden; }
[data-pane="prod"] .ch { margin-bottom: 6px; flex-shrink: 0; }

/* Analytics productores form */
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prod-field { display: flex; flex-direction: column; gap: 6px; }
.prod-field label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.prod-field textarea { width: 100%; min-height: 110px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 11px 13px; font-family: inherit; font-size: 11.5px; color: var(--ink); resize: vertical; line-height: 1.5; box-sizing: border-box; transition: border-color 0.15s; }
.prod-field textarea::placeholder { color: var(--muted); font-weight: 400; }
.prod-field textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(74,100,55,0.14); }
.prod-field textarea.drag-over { border-color: var(--pine); background: rgba(74,100,55,0.05); }
.prod-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.prod-hint { font-size: 11.5px; color: var(--muted); }
.prod-hint b { color: var(--ink); font-weight: 700; }
.btn-analizar { background: var(--pine); color: #fff; border: none; border-radius: 0; padding: 9px 22px; font-family: var(--f-ui); font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-analizar:hover { background: #4a6437; }
.btn-analizar:disabled { opacity: 0.6; cursor: not-allowed; }

/* Analytics transportes */
.filt-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; }
.filt-bar .lbl { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.filt-bar .input, .filt-bar .select { font-size: 12px; padding: 6px 10px; height: 30px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); color: var(--ink); }
.filt-bar .search-box { margin-left: auto; display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); padding: 6px 11px; border-radius: 0; font-size: 12px; color: var(--muted); min-width: 260px; }
.filt-bar .search-box input { border: none; outline: none; background: transparent; font-size: 12px; flex: 1; color: var(--ink); }
.filt-bar .search-box svg { width: 13px; height: 13px; opacity: 0.6; flex-shrink: 0; }

.ranking-row { display: grid; grid-template-columns: 22px 1fr 60px 80px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.ranking-row:last-child { border-bottom: none; }
.ranking-row.head { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ranking-row.head span { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.ranking-row.head span:last-child, .ranking-row.head span:nth-last-child(2) { text-align: right; }
.ranking-row .rk { width: 20px; height: 20px; border-radius: 0; background: rgba(74,100,55,0.12); color: var(--pine); font-weight: 700; font-size: 10.5px; display: flex; align-items: center; justify-content: center; }
.ranking-row.top .rk { background: var(--pine); color: #fff; }
.ranking-row .nm { font-family: var(--f-display); font-weight: 700; font-size: 12px; color: var(--ink); letter-spacing: 0.3px; text-transform: uppercase; }
.ranking-row .v { font-weight: 700; font-size: 12px; text-align: right; color: var(--ink); }
.ranking-row .tn { font-weight: 600; font-size: 11.5px; text-align: right; color: var(--ink); }
.ranking-row .tn .u { font-family: var(--f-ui); font-weight: 500; color: var(--muted); font-size: 10px; margin-left: 2px; }

.bdx-row { display: grid; grid-template-columns: 1fr 60px 58px 0.8fr 46px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.bdx-row:last-child { border-bottom: none; }
.bdx-row.head { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.bdx-row.head span { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.bdx-row.head span:nth-child(2), .bdx-row.head span:nth-child(3), .bdx-row.head span:nth-child(5) { text-align: right; }
.bdx-row.head span:nth-child(4) { text-align: center; }
.bdx-row .nm { font-family: var(--f-display); font-weight: 700; font-size: 11.5px; color: var(--ink); letter-spacing: 0.3px; text-transform: uppercase; }
.bdx-row .vt, .bdx-row .bd { font-weight: 600; font-size: 11.5px; text-align: right; color: var(--ink); }
.bdx-row .bar { height: 5px; border-radius: 0; background: rgba(22,32,26,0.08); position: relative; overflow: hidden; }
.bdx-row .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #7a1f24; }
.bdx-row .pct { font-weight: 700; font-size: 11.5px; text-align: right; color: #7a1f24; }

.chof-row { display: grid; grid-template-columns: 22px 1fr 1fr 30px; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.chof-row:last-child { border-bottom: none; }
.chof-row.head { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.chof-row.head span { font-size: 9.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.chof-row.head span:last-child { text-align: right; }
.chof-row .rk { width: 18px; height: 18px; border-radius: 0; background: rgba(22,32,26,0.06); color: var(--muted); font-weight: 700; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.chof-row .driver { font-family: var(--f-display); font-weight: 700; font-size: 11.5px; color: var(--ink); letter-spacing: 0.3px; text-transform: uppercase; }
.chof-row .transp { color: var(--muted); font-size: 11px; }
.chof-row .n { font-weight: 700; font-size: 12px; text-align: right; color: #7a1f24; }
.chof-row.pct-row { grid-template-columns: 22px 1fr 1fr 40px 36px; }
.chof-row.pct-row .n { color: #7a1f24; }
.chof-row.pct-row .ratio { font-weight: 500; font-size: 10.5px; color: var(--muted); text-align: right; }
.chof-split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.chof-split-grid .col-h { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #7a1f24; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid #7a1f24; }
