:root {
  --field: #16302A;
  --field-2: #22463C;
  --gold: #E2A916;
  --gold-ink: #3A2A00;
  --paper: #FAFAF6;
  --card: #FFFFFF;
  --ink: #1A2420;
  --muted: #56625C;
  --line: #DCE0D8;
  --ok: #2B6A43;
  --warn: #A9501A;
  --radius-s: 8px;
  --radius-m: 14px;
  --display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --body: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Header */
.top { background: var(--field); color: #F2F4EE; }
.top-in { display: flex; justify-content: space-between; align-items: center; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 20px; }
.brand svg { color: var(--gold); }
.top nav { display: flex; gap: 20px; }
.top nav a { text-decoration: none; font-weight: 500; color: #D7DDD5; }
.top nav a:hover { color: #FFFFFF; }

/* Hero */
.hero { background: var(--field); color: #F2F4EE; padding: 56px 0 72px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 700; letter-spacing: -0.01em; max-width: 15ch; }
.lead { margin-top: 24px; font-size: 19px; color: #CDD5CB; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--radius-s); font-weight: 600; font-size: 16px; text-decoration: none; border: 0; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #F0B925; }
.btn-line { border: 1.5px solid #6E8A80; color: #F2F4EE; }
.btn-line:hover { border-color: #F2F4EE; }
.btn-green { background: var(--ok); color: #FFFFFF; }
.btn-green:hover { background: #235A38; }
.btn-dark { background: var(--ink); color: #FFFFFF; margin-top: 16px; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid #C5CCC2; }
.btn-ghost:hover { border-color: var(--ink); }

/* Ticket: el elemento memorable, como un remito de balanza */
.ticket {
  background: #FFFDF5;
  color: var(--ink);
  border-radius: 4px;
  padding: 24px 24px 20px;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.55);
  position: relative;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, #EFEBDD 31px 32px);
}
.ticket::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: radial-gradient(circle at 10px 0, #FFFDF5 7px, transparent 7.5px) repeat-x;
  background-size: 20px 10px;
}
.ticket-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--muted); }
.pill { background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.ticket-lote { font-family: var(--display); font-weight: 700; font-size: 28px; margin-top: 14px; }
.ticket-sub { color: var(--muted); }
.ticket-big { display: flex; align-items: baseline; gap: 12px; margin-top: 18px; font-weight: 500; }
.ticket-big .num { font-family: var(--display); font-weight: 700; font-size: 72px; line-height: 1; color: var(--field); }
.trucks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; min-height: 26px; }
.trucks svg { color: var(--field-2); }
.trucks svg.in { animation: drive 0.5s ease-out both; }
@keyframes drive { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.ticket-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; border-top: 1.5px dashed #CFC9B4; padding-top: 14px; }
.ticket-stats dt { font-size: 13px; color: var(--muted); }
.ticket-stats dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; }

/* Pain */
.pain { background: var(--gold); color: var(--gold-ink); }
.pain-in { padding-top: 28px; padding-bottom: 28px; }
.pain p { font-size: 20px; font-weight: 500; max-width: 70ch; }

/* Demo */
.demo { padding: 72px 0; }
.demo-head h2, .como h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; }
.demo-head p { color: var(--muted); margin-top: 8px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 28px 0 20px; border-bottom: 2px solid var(--line); }
.tabs button { background: none; border: 0; padding: 12px 18px; min-height: 48px; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tabs button:hover { color: var(--ink); }

.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .panel { flex: 999 1 560px; min-width: 0; }
.split > .lotes-panel, .split > .panel:not(.grow):last-child:not(:first-child) { flex: 1 1 280px; }
.view#view-prod .split > .panel:last-child { flex: 999 1 560px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.panel h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }

.lotes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 560px; overflow-y: auto; }
.lotes button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; min-height: 54px; }
.lotes button:hover { border-color: #9FAA9C; }
.lotes button[aria-pressed="true"] { border: 2px solid var(--ok); background: #EFF5F0; }
.lotes b { display: block; font-weight: 600; }
.lotes small { color: var(--muted); font-size: 14px; }
.lotes .trips { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }

.sel-title, .panel h3.sel-title { font-size: 30px; font-weight: 700; margin-bottom: 2px; }
.steppers { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 18px; }
.stepper { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; }
.stepper .lbl { font-size: 14px; color: var(--muted); }
.ctl { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.ctl button { width: 44px; height: 44px; border-radius: var(--radius-s); border: 1px solid #C5CCC2; background: var(--card); font-size: 20px; }
.ctl button:hover { border-color: var(--ink); }
.ctl output { font-family: var(--display); font-weight: 700; font-size: 26px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 0; }
.kpis > div { background: #F2F3EE; border-radius: var(--radius-s); padding: 14px; }
.kpis dt { font-size: 14px; color: var(--muted); }
.kpis dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 30px; }
.kpis .kpi-main { background: var(--field); }
.kpis .kpi-main dt { color: #C8D3CB; }
.kpis .kpi-main dd { color: var(--gold); }
.kpis .kpi-wide { grid-column: span 2; }
.kpis .small-dd { font-family: var(--body); font-size: 16px; font-weight: 500; }
.kpis-row { margin: 0 0 20px; }
.kpis-row > div { background: var(--card); border: 1px solid var(--line); }
dd.ok { color: var(--ok); }
dd.warn { color: var(--warn); }

.franjas-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 24px; gap: 12px; }
.franjas-head h4 { font-size: 18px; font-weight: 600; }
.franjas { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 170px; margin-top: 12px; border-bottom: 1px solid var(--line); }
.franja { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.franja .n { font-family: var(--display); font-weight: 700; font-size: 18px; }
.franja .bar { width: 100%; max-width: 64px; background: var(--field-2); border-radius: 4px 4px 0 0; transition: height 0.25s ease; }
.franja .h { font-size: 14px; color: var(--muted); padding: 6px 0 4px; }
.note { font-size: 14px; color: var(--muted); margin-top: 16px; max-width: 75ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 16px; }
.tbl th { text-align: left; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid #EEF0EB; vertical-align: middle; }
.tbl td small { display: block; color: var(--muted); font-size: 14px; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .ok { color: var(--ok); font-weight: 600; }
.tbl .warn { color: var(--warn); font-weight: 600; }
.assign { display: flex; gap: 6px; }
.assign button { width: 44px; height: 44px; border-radius: var(--radius-s); border: 1px solid #C5CCC2; background: var(--card); font-size: 18px; }
.assign button.plus { background: var(--ok); color: #FFFFFF; border-color: var(--ok); }

.fleteros { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fleteros li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid #EEF0EB; border-radius: var(--radius-s); padding: 10px 12px; }
.fleteros b { display: block; font-weight: 600; }
.fleteros small { color: var(--muted); font-size: 14px; }
.fleteros li > span:last-child { font-family: var(--display); font-weight: 700; font-size: 18px; white-space: nowrap; }

/* Chofer */
.chofer { display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; align-items: flex-start; }
.phone { width: 360px; max-width: 100%; background: var(--ink); border-radius: 40px; padding: 12px; }
.screen { background: var(--card); border-radius: 30px; padding: 22px 18px; min-height: 640px; display: flex; flex-direction: column; gap: 10px; }
.trip { background: #F2F3EE; border-radius: var(--radius-s); padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.estados { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.estados li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-s); color: #6A756F; }
.estados li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C5CCC2; flex: none; box-sizing: border-box; }
.estados li.done { color: var(--ink); }
.estados li.done::before { background: var(--ok); border-color: var(--ok); }
.estados li.cur { background: #EFF5F0; color: var(--ink); font-weight: 600; }
.estados li.cur::before { border: 4px solid var(--ok); }
.btn.big { margin-top: auto; min-height: 54px; font-size: 17px; }
.chofer-copy { flex: 0 1 380px; display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
.chofer-copy h3 { font-size: 26px; font-weight: 700; }
.chofer-copy .btn { align-self: flex-start; }

/* Cómo funciona: es una secuencia real, por eso numerada */
.como { background: var(--card); border-top: 1px solid var(--line); padding: 72px 0; }
.pasos { list-style: none; counter-reset: paso; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px; }
.pasos li { counter-increment: paso; border-top: 3px solid var(--field); padding-top: 16px; }
.pasos li::before { content: counter(paso); font-family: var(--display); font-weight: 700; font-size: 44px; color: var(--gold); line-height: 1; display: block; margin-bottom: 8px; }
.pasos h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.pasos p { color: var(--muted); }

.foot { background: var(--field); color: #B9C4BC; padding: 24px 0; font-size: 15px; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 40px; }
  .kpis .kpi-wide { grid-column: auto; }
}
@media (max-width: 640px) {
  .lotes { flex-direction: row; overflow-x: auto; max-height: none; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .lotes li { flex: 0 0 220px; scroll-snap-align: start; }
  .lotes button { height: 100%; }
  .tbl { min-width: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin-bottom: 10px; }
  .tbl td { border: 0; padding: 0; }
  .tbl td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
  .tbl td.full { grid-column: 1 / -1; }
  .tbl td.full::before { display: none; }
}
@media (max-width: 520px) {
  .top nav { gap: 14px; font-size: 15px; }
  .brand span { font-size: 18px; }
  .ticket-big .num { font-size: 60px; }
  .franjas { gap: 6px; }
}
