@font-face { font-family: Roboto; src: url("/fonts/roboto.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: light;
  --ink: #26292e; --red: #bf0909; --accent: #ffffff; --paper: #f6f9fc;
  --line: #dee3ea; --muted: #555869; --white: #ffffff;
  font: 16px/1.5 "Roboto", Arial, system-ui, sans-serif;
  color: var(--ink); background: var(--paper); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .62; cursor: wait; }
:focus-visible { outline: 3px solid #1363d0; outline-offset: 3px; }
.top { border-top: 5px solid var(--red); border-bottom: 1px solid var(--line); background: white; color: var(--ink); padding-top: env(safe-area-inset-top); }
.top-inner { max-width: 1184px; margin: auto; min-height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.brand, .header-tools { display: flex; align-items: center; gap: 12px; }
.brand small { font-size: .78rem; letter-spacing: 0; }
.brand strong { display: block; line-height: 1.1; }
.brand { gap: 10px; font-size: 1.6rem; font-weight: 800; letter-spacing: -.055em; }
.signal { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; }
.signal::before, .ticket-top span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.signal::before { background: #126b49; }
.signal.offline::before { background: #997300; }
.bar-button { background: transparent; color: inherit; border: 1px solid #979797; padding: 7px 14px; border-radius: 8px; min-height: 40px; }
main { max-width: 730px; margin: 0 auto; padding: 46px 24px max(58px, env(safe-area-inset-bottom)); outline: none; }
main.wide { max-width: 1184px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.05rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.055em; text-wrap: balance; overflow-wrap: anywhere; }
h2 { font-size: 1.35rem; line-height: 1.2; letter-spacing: -.033em; }
.eyebrow, .ticket-top { font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { color: var(--muted); margin-bottom: 9px; }
.intro, .date, .muted, .footnote, .hint, small { color: var(--muted); }
.intro, .date { margin: 10px 0 20px; }
.footnote, .hint, .lookup, small { font-size: .87rem; }
.footnote { margin: 18px 0 0; }
.card, .metrics > div { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: clamp(18px, 4vw, 30px); }
.card + .card, .list > * + * { margin-top: 16px; }
.card.narrow { max-width: 520px; margin-inline: auto; }
.login { margin-top: clamp(16px, 7vh, 80px); border-top: 5px solid var(--red); }
.card > h2 + p, .card > h1 + p, .card > p + .stack { margin-top: 14px; }
.stack, label { display: grid; gap: 7px; }
.stack { gap: 17px; }
.stack > .eyebrow, .stack > .intro { margin: 0; }
label { font-size: .93rem; font-weight: 650; min-width: 0; }
label small { font-weight: 400; }
input, select, textarea { background: white; border: 1px solid #7d7f82; border-radius: 9px; padding: 11px 12px; min-height: 48px; width: 100%; min-width: 0; font-size: 1rem; }
input#dni { font-variant-numeric: tabular-nums; letter-spacing: .12em; }
textarea { resize: vertical; }
button { border-radius: 9px; font-weight: 650; }
.primary, .secondary { min-height: 48px; padding: 12px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; }
.primary { color: white; background: var(--red); border: 1px solid var(--red); }
.primary:hover:not(:disabled) { background: #930707; }
.secondary { color: var(--red); background: transparent; border: 1px solid #8a94a2; }
.secondary:hover:not(:disabled) { background: #eef3fb; }
.primary span { color: var(--accent); font-size: 1.2rem; line-height: 1; }
.text-button, .back { border: 0; background: transparent; color: #184397; min-height: 44px; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }
.back { margin-bottom: 8px; text-decoration: none; }
.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.heading-row .date { margin-bottom: 0; }
.trip-row { display: flex; align-items: center; gap: 16px; }
.trip-time { font-size: 1.4rem; font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1.25; padding-right: 16px; border-right: 1px solid var(--line); }
.trip-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
small { display: block; font-weight: 450; line-height: 1.4; }
.tag { display: inline-block; border-radius: 5px; background: #edf0f4; color: var(--red); font-size: .84rem; padding: 3px 8px; }
.tag::first-letter, .date::first-letter, .ticket-date::first-letter { text-transform: uppercase; }
.ticket { border-radius: 8px; border-left: 6px solid var(--red); background: #26292e; color: white; overflow: hidden; }
.ticket-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed #656a8a; padding: 16px 24px; color: #ffffff; overflow-wrap: anywhere; }
.ticket-top span { display: flex; align-items: center; gap: 8px; }
.ticket-top b { text-align: right; }
.ticket-body { padding: clamp(22px, 4vw, 34px); }
.ticket-date { font-size: .92rem; color: #dee3ea; }
.ticket-date.via { margin: -10px 0 18px; }
.route { margin: 10px 0 24px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.route-arrow { color: var(--accent); font-weight: 400; }
.rail { display: flex; align-items: center; justify-content: space-between; border-top: 2px solid #8a94a2; margin: 20px 3px 24px; height: 0; }
.rail i { display: block; width: 11px; height: 11px; background: #26292e; border: 2px solid var(--accent); border-radius: 50%; margin-top: -2px; }
.rail i:first-child, .rail i:last-child { background: var(--accent); }
.ticket-count { display: flex; align-items: baseline; gap: 12px; color: #eef3fb; }
.ticket-count strong { font-weight: 700; font-size: 3.8rem; letter-spacing: -.08em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.operator-actions { display: grid; gap: 12px; margin: 22px 0 14px; }
.large { min-height: 55px; font-size: 1.04rem; }
.sync-line { display: flex; gap: 12px; align-items: center; justify-content: space-between; color: var(--muted); font-size: .9rem; margin-top: 12px; min-height: 32px; }
.sync-line span::before { content: "✓ "; }
.sync-line .pending { color: #795011; }
.sync-line .pending::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.camera { position: relative; background: #26292e; overflow: hidden; border-radius: 12px; aspect-ratio: 1.58; }
.camera video { width: 100%; height: 100%; object-fit: contain; }
.frame { position: absolute; inset: 6%; border: 1px dashed #ffffffb8; border-radius: 8px; pointer-events: none; }
.check { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 12px; background: #eef3fb; border-radius: 9px; font-weight: 520; }
.check input { width: 21px; min-height: 21px; height: 21px; flex: 0 0 21px; accent-color: var(--red); }
.lookup { color: #184397; }
.error { margin: 12px 0; padding: 11px 14px; background: #fbebe3; border-left: 3px solid #a34528; color: #6d2a19; overflow-wrap: anywhere; }
.notice { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 10px; color: white; background: #26292e; z-index: 5; width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.filter { display: grid; grid-template-columns: 1fr 1fr minmax(160px, 2fr) auto; gap: 12px; align-items: end; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 20px 0; }
.metrics > div { display: grid; gap: 4px; }
.metrics > div:first-child { background: var(--red); color: white; border-color: var(--red); }
.metrics strong { font-size: 2.7rem; letter-spacing: -.07em; line-height: 1.2; }
.metrics > div:first-child strong { color: var(--accent); }
.daily { margin-top: 12px; }
.daily > div { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr 35px; align-items: center; gap: 10px; padding: 5px 0; }
.daily meter { width: 100%; accent-color: var(--red); }
.daily meter::-webkit-meter-optimum-value { background: #184397; }
.daily b { text-align: right; }
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; text-align: left; }
th { color: var(--muted); font-size: .82rem; }
td, th { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.admin-cols > .card { margin: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.manifest dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 15px; align-items: baseline; }
.manifest dt { color: var(--muted); }
.manifest dd { margin: 0; font-weight: 600; }
@media (max-width: 680px) {
  .header-tools { gap: 6px; }
  .brand small { font-size: .73rem; }
  .top-inner { min-height: 65px; padding: 0 17px; }
  main { padding: 24px 16px 55px; }
  .heading-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .trip-row { display: grid; grid-template-columns: auto 1fr; }
  .trip-row button { grid-column: 1/-1; }
  .filter { grid-template-columns: 1fr 1fr; }
  .filter label:nth-child(3), .filter button { grid-column: 1/-1; }
  .metrics { gap: 6px; }
  .metrics > div { padding: 12px; font-size: .78rem; }
  .metrics strong { font-size: 1.9rem; }
  .admin-cols { grid-template-columns: 1fr; }
  .ticket-top { padding: 13px 18px; }
  .daily > div { grid-template-columns: minmax(100px, 1.5fr) 1fr 28px; font-size: .85rem; }
}
@media print {
  :root, body { color: #000; background: #fff; font-size: 10pt; }
  .top, .no-print, .notice, button { display: none !important; }
  main, main.wide, .card { border: 0; margin: 0; padding: 0; max-width: none; }
  .table-scroll { overflow: visible; }
  table { font-size: 9pt; } tr { break-inside: avoid; }
  @page { margin: 13mm; }
}
