:root {
  --brand: #0b5296;
  --brand-dark: #083d70;
  --brand-light: #e6eff8;
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #1c2733;
  --muted: #667585;
  --line: #dde4ec;
  --ok: #1d7a46;
  --warn: #9a6200;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--brand); }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.sidebar .brand { padding: 4px 8px 20px; border-bottom: 1px solid rgba(255,255,255,.2); margin-bottom: 14px; }
.sidebar .brand img { width: 100%; max-width: 180px; display: block; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  color: #fff; text-decoration: none; padding: 9px 12px; border-radius: 8px; opacity: .9;
  display: flex; align-items: center; gap: 11px;
}
.sidebar nav a .nav-ic { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.sidebar nav a.active { background: #fff; color: var(--brand); font-weight: 600; opacity: 1; }
.sidebar .nav-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .65; padding: 12px 12px 4px; }
.sidebar .userbox { border-top: 1px solid rgba(255,255,255,.2); padding-top: 12px; font-size: 13px; }
.sidebar .userbox small { display: block; opacity: .75; }
.sidebar .userbox button {
  margin-top: 8px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.sidebar .userbox button:hover { background: rgba(255,255,255,.12); }

.main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.main h1 { margin: 0 0 4px; font-size: 24px; color: var(--brand); }
.main .lead { margin: 0 0 22px; color: var(--muted); }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; padding: 14px 16px; }
.stat .value { font-size: 28px; font-weight: 700; color: var(--brand); }
.stat .label { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--brand-light); color: var(--brand); }
.badge.off { background: #eceff3; color: var(--muted); }

.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 5px 12px; font-size: 13px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], input[type=time], select {
  width: 100%; height: 40px; padding: 0 11px; border: 1px solid #c4cfdb; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { width: 100%; padding: 9px 11px; border: 1px solid #c4cfdb; border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--brand-light); border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; align-items: end; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin: 0; }
.check input { width: auto; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.ok { background: #e4f4ea; color: var(--ok); border: 1px solid #b9e0c7; }
.alert.warn { background: #fff4de; color: var(--warn); border: 1px solid #f1d9a2; }
.alert.err { background: #fdeceb; color: var(--danger); border: 1px solid #f3c3c0; }
.alert ul { margin: 0; padding-left: 18px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: 14px; }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Matriz de tarifas ---------- */
.matrix-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.matrix { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.matrix th, .matrix td { border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 4px; text-align: center; }
.matrix thead th { background: var(--brand); color: #fff; position: sticky; top: 0; font-size: 11px; white-space: nowrap; padding: 8px 6px; }
.matrix tbody th { background: var(--brand-light); color: var(--brand); text-align: left; position: sticky; left: 0; white-space: nowrap; padding: 6px 10px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.matrix td.blank { background: #f1f4f8; }
.matrix input { width: 86px; text-align: right; padding: 6px 8px; }

/* ---------- Plano de asientos ---------- */
.bus-grid { display: grid; grid-template-columns: 1fr 1fr 34px 1fr 1fr; gap: 8px; max-width: 460px; }
.seat { border: 2px solid var(--brand); border-radius: 10px; padding: 6px; background: #fff; text-align: center; }
.seat.inactive { border-style: dashed; border-color: #b6c2cf; background: #f1f4f8; }
.seat input[type=number] { text-align: center; font-weight: 700; padding: 5px; }
.seat .check { justify-content: center; font-size: 12px; margin-top: 4px; color: var(--muted); }
.aisle { background: repeating-linear-gradient(0deg, transparent 0 8px, var(--brand-light) 8px 10px); border-radius: 6px; }
.empty-cell { visibility: hidden; }

/* ---------- Login ---------- */
body.login { background: var(--brand); display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { width: 100%; max-width: 400px; }
.login-box .logo { text-align: center; margin-bottom: 22px; }
.login-box .logo img { width: 230px; max-width: 80%; }
.login-box .panel { background: #fff; border-radius: 14px; padding: 26px 24px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.login-box h1 { margin: 0 0 16px; font-size: 20px; color: var(--brand); text-align: center; }
.login-box .field { margin-bottom: 14px; }
.login-box .btn { width: 100%; padding: 11px; font-size: 15px; }

/* Barra superior con menú hamburguesa (solo en móvil) */
.topbar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .main { padding: 20px 16px 50px; }

  .topbar {
    display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 40;
    background: var(--brand); padding: 10px 14px; box-shadow: 0 2px 6px rgba(0,0,0,.18);
  }
  .topbar img { height: 30px; width: auto; display: block; }
  .menu-btn {
    width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; padding: 0;
  }
  .menu-btn span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
  body.nav-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 270px; max-width: 85vw; z-index: 60;
    overflow-y: auto; transform: translateX(-100%); transition: transform .25s ease;
  }
  .sidebar .brand { display: none; }
  body.nav-open .sidebar { transform: none; box-shadow: 4px 0 18px rgba(0,0,0,.3); }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: none; }
  body.nav-open .nav-backdrop { display: block; }
}
@media print { .topbar, .nav-backdrop { display: none !important; } }

/* ---------- Fase 2: horarios y salidas ---------- */
.days-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; }
.days-row > span { color: var(--muted); font-size: 13px; }

.trip-toolbar { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.date-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.inline-form input[type=date] { width: auto; }

.trip-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.trip-time { font-size: 24px; font-weight: 700; color: var(--brand); }
.trip-dir { font-weight: 600; }

details summary { cursor: pointer; color: var(--brand); font-size: 14px; }
.stop-times { margin: 10px 0 0; padding-left: 22px; columns: 2; font-size: 14px; }
.stop-times li { break-inside: avoid; padding: 2px 0; }
.stop-times strong { margin-left: 8px; color: var(--brand); }

/* ---------- Precios dinámicos ---------- */
.chip { display: inline-block; background: var(--brand-light); color: var(--brand); border-radius: 6px; padding: 2px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.final-price { font-size: 28px; font-weight: 700; color: var(--brand); }
td.actions { white-space: nowrap; }
td.actions > * { display: inline-block; margin: 2px 4px 2px 0; vertical-align: middle; }
td.actions form { margin: 0; display: inline-block; }

/* ---------- Venta en mostrador ---------- */
.muted { color: var(--muted); }
.result-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.seat-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; margin-bottom: 14px; }
.seat-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 2px solid var(--brand); }
.sw.free { background: #fff; }
.sw.selected { background: var(--brand); }
.sw.sold { background: #c9d1da; border-color: #c9d1da; }
.sw.held { background: #ffe3a3; border-color: #e6b94d; }
.bus-front { max-width: 300px; text-align: center; font-size: 12px; color: var(--muted); border-bottom: 3px solid var(--brand); padding-bottom: 4px; margin-bottom: 12px; }
.sale-grid { display: grid; grid-template-columns: 1fr 1fr 28px 1fr 1fr; gap: 8px; max-width: 300px; }
.pick { display: block; margin: 0; }
.pick span { display: flex; align-items: center; justify-content: center; height: 44px; border: 2px solid var(--brand); border-radius: 10px; background: #fff; font-weight: 700; color: var(--brand); cursor: pointer; user-select: none; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick.free input:checked + span { background: var(--brand); color: #fff; }
.pick.sold span { background: #c9d1da; border-color: #c9d1da; color: #6b7785; cursor: not-allowed; }
.pick.held span { background: #ffe3a3; border-color: #e6b94d; color: #8a6410; cursor: not-allowed; }
.pick.off { height: 44px; }
.pick.free input:focus-visible + span { outline: 3px solid #8fb6e0; }

/* ---------- Pasajes ---------- */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 18px; }
.ticket { background: #fff; border: 2px solid var(--brand); border-radius: 12px; overflow: hidden; padding-bottom: 12px; }
.ticket-head { display: flex; justify-content: space-between; background: var(--brand); color: #fff; padding: 10px 14px; font-size: 14px; }
.ticket-body { display: flex; gap: 12px; padding: 12px 14px 0; justify-content: space-between; }
.ticket-info { font-size: 14px; line-height: 1.5; }
.ticket-info hr { border: 0; border-top: 1px dashed #b6c2cf; margin: 8px 0; }
.ticket-seat { font-size: 20px; font-weight: 700; color: var(--brand); }
.ticket-price { font-weight: 700; margin-top: 4px; }
.ticket-qr { text-align: center; font-size: 10px; color: var(--muted); }
.ticket-qr svg { width: 136px; height: 136px; display: block; background: #fff; }
.ticket.void { opacity: .55; }
.ticket > form { padding: 0 14px; }

@media print {
    .sidebar, aside, .no-print, .alert { display: none !important; }
    .main { margin: 0 !important; padding: 0 !important; }
    body { background: #fff; }
    .ticket { break-inside: avoid; }
    .card { box-shadow: none; }
}

/* ---------- Sitio público de compra ---------- */
.pub-header { background: var(--brand); color: #fff; padding: 14px 0; }
.pub-header .pub-wrap { display: flex; align-items: center; gap: 16px; }
.pub-header img { height: 44px; display: block; }
.pub-header span { opacity: .85; font-size: 15px; }
.pub-wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.pub-main { padding-top: 22px; padding-bottom: 40px; }
.pub-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; border-top: 1px solid var(--line); }
body.public h1 { margin-top: 0; }

/* ---------- Abordaje ---------- */
.verdict { border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; font-size: 18px; text-align: center; border: 2px solid var(--line); background: #fff; }
.verdict.idle { color: var(--muted); }
.verdict.good { background: #e4f4ea; border-color: #1d7a46; color: #14532f; }
.verdict.bad { background: #fdeceb; border-color: #b3261e; color: #8a1c16; }

/* ---------- Reportes ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
table td.num, table th.num { text-align: right; white-space: nowrap; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--brand); min-width: 2px; }
.bar-wrap { background: var(--brand-light); border-radius: 4px; width: 100%; min-width: 80px; }

/* ---------- Selector de fecha ---------- */
.dp { position: relative; width: 100%; }
.dp-native { position: absolute !important; left: 50%; bottom: 0; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.dp-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 11px; background: #fff; border: 1px solid #c4cfdb; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 400; color: var(--text); cursor: pointer; text-align: left; }
.dp-btn:hover { border-color: #9fb3c9; }
.dp.open .dp-btn, .dp-btn:focus-visible { border-color: var(--brand); outline: 2px solid var(--brand-light); }
.dp-ico { color: var(--brand); display: inline-flex; flex: none; }
.dp-label { flex: 1; color: #55606c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-label.has { color: var(--text); }
.dp-chev { color: var(--brand); display: inline-flex; flex: none; transition: transform .15s; transform: rotate(180deg); }
.dp.open .dp-chev { transform: rotate(0deg); }
.dp-time { margin-top: 8px; width: 100%; }
.dp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 40px rgba(20, 40, 70, .18); overflow: hidden; }
.dp-pop[hidden] { display: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px; background: #f7f9fc; border-bottom: 1px solid var(--line); }
.dp-title { font-weight: 700; font-size: 17px; color: var(--brand); }
.dp-nav { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--brand); cursor: pointer; padding: 0; }
.dp-nav:hover:not(:disabled) { background: var(--brand-light); }
.dp-nav:disabled { background: #f0f2f5; color: #b3bcc7; cursor: not-allowed; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-dow { text-align: center; padding: 10px 0; font-size: 13px; font-weight: 700; color: #8a949f; background: #fafbfc; border-bottom: 1px solid var(--line); }
.dp-cell { height: 44px; display: flex; align-items: center; justify-content: center; border: 0; border-right: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; background: #fff; font: inherit; font-size: 16px; color: var(--text); cursor: pointer; padding: 0; }
.dp-grid .dp-cell:nth-child(7n) { border-right: 0; }
button.dp-cell:hover:not(:disabled) { background: var(--brand-light); }
.dp-cell.dp-empty { background: #fafbfc; cursor: default; }
.dp-cell.dp-off { color: #c3cad2; background: #fafbfc; cursor: not-allowed; }
.dp-cell.dp-today { color: var(--brand); font-weight: 800; }
.dp-cell.dp-sel { background: var(--brand); color: #fff; font-weight: 700; }
button.dp-cell.dp-sel:hover { background: var(--brand-dark); }
.dp-clear { display: block; width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--brand); font: inherit; cursor: pointer; }
.date-nav .dp, .inline-form .dp { width: 250px; }

/* ---------- Cabecera pública y gestión de boleto ---------- */
.pub-header .pub-wrap { flex-wrap: wrap; justify-content: space-between; }
.pub-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-nav a { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.55); border-radius: 99px; padding: 7px 14px; font-size: 14px; font-weight: 600; }
.pub-nav a:hover { background: rgba(255,255,255,.16); }
.manage-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 10px; }
.manage-actions form { margin: 0; min-width: 240px; }

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.wa-icon { width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); transition: transform .15s; }
.wa-float:hover .wa-icon { transform: scale(1.07); }
.wa-text { background: #fff; color: #1c2733; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 99px; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
@media (max-width: 600px) { .wa-text { display: none; } }
.logo-preview { background: var(--brand); padding: 14px 18px; border-radius: 10px; display: inline-block; }
.logo-preview img { max-height: 60px; display: block; }

/* Servicio Petfriendly */
.pet-box h2, .pet-card h2 { margin-top: 0; }
.pet-card { border-left: 4px solid var(--brand); background: var(--brand-light, #eef4fb); }

/* Lista de pasajeros */
.pl-sheet { background: #fff; border: 1px solid var(--line, #dde4ec); border-radius: 10px; overflow: hidden; margin-top: 14px; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--brand); color: #fff; padding: 12px 18px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pl-head img { height: 38px; width: auto; display: block; }
.pl-title { font-size: 20px; font-weight: 700; }
.pl-info { padding: 12px 18px; line-height: 1.7; border-bottom: 1px solid var(--line, #dde4ec); }
.pl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-table th, .pl-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #e6ebf1; vertical-align: top; }
.pl-table thead th { background: #f1f5f9; font-size: 12px; }
.pl-check { text-align: center; font-size: 16px; white-space: nowrap; }
.pl-sheet { overflow-x: auto; }
@media print {
    .pl-sheet { border: 0; border-radius: 0; overflow: visible; }
    .pl-table { font-size: 11px; }
    .pl-table tr { break-inside: avoid; }
}

/* Paraderos compactos */
.points-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.points-grid .card { margin: 0; }
.points-title { margin: 0 0 10px; font-size: 17px; color: var(--brand); }
.points-grid textarea { width: 100%; line-height: 1.5; }

/* Compra web: datos de pasajeros (diseño en tarjetas con resumen) */
.checkout { position: relative; left: 50%; transform: translateX(-50%); width: min(1080px, calc(100vw - 32px)); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.checkout-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.co-card { background: #fff; border: 1px solid #e3e9f0; border-radius: 16px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16,40,70,.06); }
.checkout-side .co-card { margin-bottom: 0; }
.co-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; background: var(--brand-light, #e8eef6); color: var(--brand); }
.co-title { font-weight: 700; font-size: 16px; }
.co-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.co-body { padding: 18px 20px; }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.co-grid .span-2 { grid-column: 1 / -1; }
.co-grid label, .co-apply + .co-msg { font-size: 12px; }
.co-grid label { display: block; margin-bottom: 6px; font-weight: 700; color: #6b7a90; letter-spacing: .03em; text-transform: uppercase; }
.co-grid input, .co-grid select { width: 100%; border-radius: 12px; padding: 12px 14px; }
.co-sub { margin: 0 0 8px; font-weight: 700; color: var(--brand); }
.co-sub:not(:first-child) { margin-top: 16px; }
.co-apply { display: flex; gap: 8px; }
.co-apply input { flex: 1; min-width: 0; }
.co-msg { display: block; margin-top: 6px; font-size: 13px; min-height: 18px; }
.co-msg.ok { color: #1a7f4b; }
.co-msg.bad, .co-err { color: var(--danger, #b3261e); font-size: 13px; }
.co-card.is-pet { border-left: 4px solid var(--brand); }
.co-trip { margin-bottom: 14px; line-height: 1.5; }
.co-seats { padding-top: 10px; border-top: 1px solid #eef2f6; }
.co-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eef2f6; }
.co-line.is-discount span:last-child { color: #1a7f4b; font-weight: 700; }
.co-total { display: flex; justify-content: space-between; align-items: center; margin: 12px -20px -18px; padding: 16px 20px; background: #fbf7e6; }
.co-total strong { font-size: 26px; color: var(--brand); }
.co-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.co-back { white-space: nowrap; text-decoration: none; }
.co-pay { flex: 1; padding: 16px; font-size: 17px; border-radius: 999px; }
@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-side { position: static; order: -1; }
  .co-grid { grid-template-columns: 1fr; }
  .co-actions { flex-direction: column-reverse; align-items: stretch; }
}

/* Horarios: dos columnas por sentido */
.sch-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.sch-col-title { margin: 0 0 10px; color: var(--brand); font-size: 18px; }
.sch-card { padding: 14px 16px; margin-bottom: 12px; }
.sch-card.is-off { opacity: .75; background: #f7f8fa; }
.sch-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sch-time { width: 120px; font-size: 20px; font-weight: 700; }
.sch-bus { margin-top: 10px; }
.sch-bus label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: #6b7a90; text-transform: uppercase; }
.sch-actions { display: flex; gap: 8px; margin-top: 12px; }
.sch-actions form { margin: 0; }
@media (max-width: 860px) { .sch-columns { grid-template-columns: 1fr; } }

/* Fase 14: paradas por servicio, oficinas */
.sch-route { margin: 10px 0 0; font-size: 13px; line-height: 1.9; }
.sch-stop { background: var(--brand-light); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.stop-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #eef0f3; }
.stop-row input[type=time] { width: 120px; }
.office-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.office-users { margin-top: 14px; border-top: 1px solid #e5e8ec; padding-top: 10px; }
.office-users ul { list-style: none; margin: 6px 0 0; padding: 0; }
.office-users li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 14px; }
.badge-role { background: var(--brand-light); color: var(--brand); border-radius: 10px; padding: 1px 8px; font-size: 12px; }

/* Fase 16: buscador compacto y resultados en una línea */
.search-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; align-items: end; }
.search-form .sf-date { grid-column: 1 / -1; }
.search-form .btn { width: 100%; }
.search-form > div:last-child { grid-column: 1 / -1; }
@media (min-width: 760px) {
    .search-form { grid-template-columns: 1.1fr 1fr 1fr auto; }
    .search-form .sf-date { grid-column: auto; }
    .search-form > div:last-child { grid-column: auto; }
    .search-form .btn { width: auto; padding-left: 28px; padding-right: 28px; }
}
.t-short, .pet-txt-off { display: none; }
@media (min-width: 640px) {
    .result-row { flex-wrap: nowrap; }
    .result-row .trip-head { flex-wrap: nowrap; margin: 0; gap: 10px; min-width: 0; }
    .result-row .btn { flex-shrink: 0; white-space: nowrap; }
    .result-row .chip { white-space: nowrap; }
    .result-row .trip-dir { white-space: nowrap; }
}
@media (min-width: 640px) and (max-width: 999px) {
    .t-long, .pet-txt { display: none; }
    .t-short { display: inline; }
    .result-row .trip-time { font-size: 20px; }
    .result-row .final-price { font-size: 18px !important; }
}

/* Fase 16: botón Buscar corto en móvil; resultados en una línea en pantallas anchas */
.bs-short { display: none; }
@media (max-width: 639px) {
    .bs-long { display: none; }
    .bs-short { display: inline; }
    .search-form { grid-template-columns: 1fr 1fr; }
    .search-form .sf-date { grid-column: 1 / -1; }
    .search-form > div:last-child { grid-column: 1 / -1; }
}
@media (min-width: 640px) {
    .result-row .trip-head > div { min-width: 0; }
    .result-row .trip-dir, .result-row small { white-space: nowrap; }
}

/* Fase 17: buscador del pasajero y selección de asientos */
.ws-form { display: flex; flex-direction: column; gap: 16px; }
.ws-route { display: grid; grid-template-columns: 1fr; gap: 12px; position: relative; }
.ws-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 16px; border-top: 1px solid #e3e9f0; }
.ws-field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #6b7a90; letter-spacing: .06em; text-transform: uppercase; }
.ws-field select, .ws-field input { width: 100%; border: 0; background: #f0f4f9; border-radius: 12px; padding: 14px 16px; font-size: 16px; font-weight: 600; color: #121b2b; }
.ws-swap { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 3px solid #2f5fb3; background: var(--brand); color: #fff; font-size: 20px; cursor: pointer; z-index: 1; }
.ws-go { border: 0; border-radius: 14px; padding: 16px; font-size: 17px; font-weight: 700; color: #fff; cursor: pointer; background: linear-gradient(120deg, var(--brand), #08305d); }
@media (min-width: 760px) {
    .ws-route { grid-template-columns: 1fr 44px 1fr; align-items: end; }
    .ws-swap { position: static; transform: none; margin-bottom: 4px; }
    .ws-ctl { display: grid; }
}
@media (max-width: 759px) {
    .ws-field select { padding-right: 56px; }
    .ws-swap { top: 62%; }
}
.seats-grid { grid-template-columns: minmax(0, 1fr) 360px; }
.seat-bus .seat-legend { justify-content: center; }
.bus-body { max-width: 340px; margin: 0 auto; padding: 16px 20px 20px; border: 2px solid #d5deea; border-radius: 28px 28px 14px 14px; background: #f7f9fc; }
.bus-body .bus-front { max-width: none; }
.bus-body .sale-grid { max-width: none; }
.seats-side .co-card .btn { width: auto; }
@media (max-width: 860px) {
    .seats-grid { grid-template-columns: 1fr; }
    .seats-side { order: 0; position: static; }
}

/* Fase 18: texto de selects del buscador sin cortes */
.ws-field select, .ws-field input { height: auto; min-height: 52px; line-height: 1.4; box-sizing: border-box; }
.ws-field select { padding-top: 12px; padding-bottom: 12px; }

/* Fase 19: tarjetas de resultado */
.trip-time .ampm { font-size: 14px; font-weight: 700; opacity: .8; }
.tc-arrive { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 600; color: #2b3a4f; font-size: 13px; }
.tc-ico { color: var(--brand); flex-shrink: 0; }
@media (max-width: 639px) {
    .result-row { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
    .result-row .trip-head { gap: 8px 12px; }
    .result-row .trip-head > div { flex: 1; min-width: 0; }
    .result-row .trip-time { font-size: 30px; }
    .result-row .final-price { flex-basis: 100%; font-size: 24px !important; }
    .result-row .btn { width: 100%; text-align: center; }
}
@media (min-width: 640px) { .tc-arrive { white-space: nowrap; } }

/* Fase 20: tarjeta de resultado (trip-card) */
.tcard { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center; background: #fff; border: 1px solid #e3e9f0; border-radius: 18px; padding: 20px 24px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(16,40,70,.06); transition: box-shadow .15s, transform .15s; }
.tcard:hover { box-shadow: 0 6px 18px rgba(16,40,70,.12); transform: translateY(-1px); }
.tcard.is-sold { opacity: .7; }
.tc-times { display: flex; align-items: center; gap: 16px; }
.tc-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; min-width: 96px; }
.tc-big { font-size: 34px; font-weight: 800; color: var(--brand); line-height: 1; letter-spacing: -.02em; }
.tc-big.sm { font-size: 26px; color: #2b3a4f; }
.tc-ap { font-size: 13px; font-weight: 700; color: #6b7a90; text-transform: lowercase; }
.tc-cap { flex-basis: 100%; margin-top: 6px; font-size: 14px; font-weight: 600; color: #2b3a4f; display: flex; align-items: center; gap: 6px; }
.tc-line { flex: 1; min-width: 40px; max-width: 160px; display: flex; align-items: center; align-self: flex-start; margin-top: 14px; }
.tc-line b { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, #b8c6d8 0 6px, transparent 6px 10px); }
.tc-line i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--brand); background: #fff; }
.tc-tip { position: relative; display: inline-flex; color: var(--brand); cursor: help; outline: none; }
.tc-tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; background: #1f2a3a; color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.tc-tip:hover::after, .tc-tip:focus::after { opacity: 1; }
.tc-services { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.svc { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #eef3f9; color: var(--brand); font-size: 13px; font-weight: 600; }
.svc-express { background: var(--brand); color: #fff; }
.svc-low { background: #fff1d6; color: #8a5a00; }
.svc-off { background: #e6e9ee; color: #5d6978; }
.svc-icon { background: #f2f4f7; color: #46556a; }
.tc-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tc-price { font-size: 30px; font-weight: 800; color: var(--brand); line-height: 1; }
.tc-buy .btn { white-space: nowrap; padding: 12px 22px; border-radius: 12px; }
@media (max-width: 639px) {
    .tcard { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
    .tc-buy { flex-direction: row; align-items: center; justify-content: space-between; border-top: 1px solid #eef2f6; padding-top: 14px; }
    .tc-buy .btn { flex: 1; text-align: center; }
    .tc-big { font-size: 30px; }
}

/* Fase 21: ajustes de tarjeta y venta en un solo paso */
.tc-times { gap: 10px; }
.tc-t { min-width: 0; }
.tc-t-end { align-items: center; padding-left: 0; }
.tc-t-end .tc-tip { margin-right: 6px; }
.tc-t-end .tc-cap { padding-left: 0; }
.tc-big.sm { font-size: 18px; font-weight: 700; }
.tc-line { max-width: 70px; min-width: 36px; }
.tc-price { font-size: 22px; }
.pax-card { padding: 4px 0 14px; border-bottom: 1px solid #eef2f6; margin-bottom: 14px; }
.pax-card:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.pax-card.is-pet { border-left: 4px solid var(--brand); padding-left: 12px; }
.seats-side { display: flex; flex-direction: column; gap: 16px; position: static; }
.seats-side .co-card { margin-bottom: 0; }
.seats-side .co-actions { margin-top: 0; }

/* Fase 22 */
.seats-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .seats-grid { grid-template-columns: 1fr; } }

/* Fase 23: alineación de la tarjeta y resumen del viaje */
.tc-times { align-items: flex-start; }
.tc-t { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
.tc-row { display: flex; align-items: baseline; gap: 4px; height: 36px; align-items: center; }
.tc-row .tc-big { line-height: 1; }
.tc-t .tc-cap { flex-basis: auto; margin: 0; }
.tc-t-end .tc-tip { margin: 0 0 0 6px; }
.tc-line { align-self: flex-start; margin-top: 0; height: 36px; }
.trip-sum { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.trip-sum .ts-city { font-size: 20px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.trip-sum .ts-when { font-size: 13px; color: #4a5a70; margin-top: 4px; }
.trip-sum .ts-arrow { color: #8ea0b8; font-size: 22px; }
.trip-sum .ts-end { text-align: right; }
.trip-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef2f6; }
.change-date .co-grid { align-items: end; grid-template-columns: 1fr auto; }

/* Fase 24 */
.diff-neg { color: #c62828; font-weight: 700; }
.diff-pos { color: #1b8a4b; font-weight: 700; }
.change-date.co-card { overflow: visible; }
.ts-seats { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; background: #eaf3ff; border-radius: 12px; }
.ts-seats-l { font-size: 13px; font-weight: 700; color: #4a5a70; text-transform: uppercase; letter-spacing: .04em; }
.ts-seats-v { font-size: 20px; font-weight: 800; color: var(--brand); }

.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f3c3c0; }
.btn.danger:hover { background: #fdeceb; }

/* ---- Venta Express ---- */
.express-trip { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.express-trip:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }
.express-trip input { grid-row: 1 / span 2; margin-top: 4px; }
.express-trip .et-meta { grid-column: 2; font-size: 13px; color: var(--muted); }
.express-pax { display: grid; grid-template-columns: 2fr 1.2fr 1.4fr 90px auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.express-pay { display: flex; gap: 22px; margin-bottom: 10px; }
.express-total { font-size: 18px; margin: 8px 0 14px; }
@media (max-width: 760px) { .express-pax { grid-template-columns: 1fr 1fr; } }

/* ---- Planilla de liquidación ---- */
.settle-leg h3 { margin: 16px 0 8px; font-size: 15px; }
.sl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sl-head h2 { margin: 0; }
.sl-table input, .sl-table select { width: 100%; min-width: 96px; }
.sl-table td { padding: 5px 6px; }
.sl-line.sl-bad td { background: #fdeceb; }
.sl-actions { white-space: nowrap; }
.sl-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; background: var(--brand-light); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.sl-box > div > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.sl-box strong { font-size: 17px; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sum-grid span { display: block; font-size: 12px; color: var(--muted); }
.sum-grid strong { font-size: 18px; }
.diff-bad { color: #b3261e; }
.diff-ok { color: #1b7a3a; }
@media print { .settle-leg, .settle-summary { break-inside: avoid; } }
.settle-leg [data-addval] { width: auto; min-width: 120px; }

.sl-others { margin-top: 12px; }
.sl-other { display: grid; grid-template-columns: 1fr 160px auto; gap: 8px; margin-bottom: 6px; }
.print-only { display: none; }
@media (max-width: 640px) { .sl-other { grid-template-columns: 1fr 110px auto; } }

/* ---- Impresión: la planilla de liquidación cabe en una hoja ---- */
@page settle { size: A4 portrait; margin: 7mm; }
@media print {
    .print-only { display: block !important; }
    .settle-page { page: settle; font-size: 9.5px; line-height: 1.25; }
    .settle-page .settle-printhead { font-size: 12px; margin-bottom: 5px; padding-bottom: 3px; border-bottom: 1.5px solid #000; }
    .settle-page .card { border: 1px solid #999; border-radius: 0; padding: 4px 6px; margin-bottom: 5px; box-shadow: none; }
    .settle-page h2 { font-size: 11px; margin: 0 0 3px; }
    .settle-page h3 { font-size: 10px; margin: 5px 0 2px; }
    .settle-page label { font-size: 8.5px; margin: 0; color: #444; }
    .settle-page input, .settle-page select, .settle-page textarea {
        border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important;
        min-height: 0 !important; height: auto !important; font-size: 9.5px !important; width: auto !important; min-width: 0 !important;
        appearance: none; -webkit-appearance: none; -moz-appearance: none; color: #000;
        border-radius: 0 !important; text-indent: 0 !important; outline: 0 !important; text-overflow: clip;
    }
    .settle-page input[type=number]::-webkit-inner-spin-button { display: none; }
    .settle-page .form-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px 8px; }
    .settle-page .sl-head { margin: 0 0 2px; }
    .settle-page .sl-table { font-size: 9.5px; }
    .settle-page .sl-table input { width: 100% !important; display: block; text-indent: 0; margin: 0; }
    .settle-page .sl-box > div > span, .settle-page .sum-grid span { font-size: 8.5px; margin: 0; }
    .settle-page textarea { resize: none; }
    .settle-page .sl-other [data-oamt] { text-align: right; width: 100% !important; }
    .settle-page .sl-other [data-odesc] { width: 100% !important; }
    .settle-page .sl-table th, .settle-page .sl-table td { padding: 1px 4px; border-bottom: 1px solid #ddd; }
    .settle-page .sl-table th { font-size: 8.5px; }
    .settle-page .sl-empty, .settle-page .sl-actions, .settle-page .no-print { display: none !important; }
    .settle-page .sl-box { background: none; border: 1px solid #bbb; border-radius: 0; padding: 3px 6px; margin-top: 4px; gap: 4px 10px; grid-template-columns: repeat(5, 1fr); }
    .settle-page .sl-box strong { font-size: 10.5px; }
    .settle-page .sl-other { grid-template-columns: 1fr 90px; gap: 6px; margin: 0; }
    .settle-page .sl-others { margin-top: 3px; }
    .settle-page .sl-others:not(:has(.sl-other)) { display: none; }
    .settle-page .sum-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; }
    .settle-page .sum-grid strong { font-size: 11px; }
    .settle-page textarea { white-space: pre-wrap; }
    .settle-page .settle-leg, .settle-page .settle-summary { break-inside: avoid; }
    .diff-bad { color: #b3261e !important; }
    .diff-ok { color: #1b7a3a !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Impresión compacta de reportes ---- */
@media print {
    .report-page { font-size: 9px; line-height: 1.2; }
    .report-page .report-printhead { font-size: 11px; margin-bottom: 5px; padding-bottom: 3px; border-bottom: 1.5px solid #000; }
    .report-page .card { border: 0; border-radius: 0; padding: 0; margin: 0 0 6px; box-shadow: none; break-inside: avoid; }
    .report-page h2 { font-size: 10.5px; margin: 0 0 2px; }
    .report-page .hint { display: none; }
    .report-page table { font-size: 9px; }
    .report-page th, .report-page td { padding: 1px 4px !important; border-bottom: 1px solid #ddd; }
    .report-page .stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
    .report-page .stat { border: 1px solid #999; border-radius: 0; padding: 2px 4px; box-shadow: none; }
    .report-page .stat .value { font-size: 12px; }
    .report-page .stat .label { font-size: 8px; }
    .report-page .report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
    .report-page .bar-wrap { display: none; }
    .report-page .occupancy-card, .report-page .occupancy-card table { break-inside: auto; }
    .report-page tr { break-inside: avoid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@page { margin: 8mm; }

/* ---- Inicio ---- */
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.home-clock { text-align: right; background: linear-gradient(135deg, var(--brand), #1a6bc2); color: #fff; border-radius: 14px; padding: 12px 22px; box-shadow: 0 4px 14px rgba(11,82,150,.25); }
.home-clock .hc-date { font-size: 19px; font-weight: 600; }
.home-clock .hc-date::first-letter { text-transform: uppercase; }
.home-clock .hc-time { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.home-sec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.home-h { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 12px; }
.home-h svg, .tile svg { width: 21px; height: 21px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tile-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); background: #fff; transition: transform .12s, box-shadow .12s, border-color .12s; }
.tile svg { width: 26px; height: 26px; }
.tile span { font-weight: 600; font-size: 14px; line-height: 1.2; }
.tile:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(11,82,150,.15); transform: translateY(-1px); }
.home-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 860px) { .home-cols { grid-template-columns: 1fr; } }
.home-msg { background: var(--brand-light); border-left: 5px solid var(--brand); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.home-msg.is-important { background: #fff4e0; border-left-color: #e08a00; }
.home-msg small { display: block; color: var(--muted); margin-top: 4px; }
.online-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.online-row:last-of-type { border-bottom: 0; }
.dot-on { width: 10px; height: 10px; border-radius: 50%; background: #1fa34a; box-shadow: 0 0 0 3px rgba(31,163,74,.2); flex: none; }
.svc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 8px; }
@media (max-width: 860px) { .svc-cols { grid-template-columns: 1fr; } }
.svc-title { font-size: 14px; margin: 4px 0 8px; display: flex; gap: 8px; align-items: center; }
.svc-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.svc-time { font-size: 18px; font-weight: 700; color: var(--brand); min-width: 62px; }
.badge-live { background: #1fa34a; color: #fff; }
.fare-table { font-size: 13px; }
.fare-table th, .fare-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.fare-low { color: #1b7a3a; font-weight: 700; }
@media print {
    .settle-page .settle-crew { display: none !important; }
}

/* ---- Documentos ---- */
.doc-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-ic { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-main { flex: 1; min-width: 0; }
.doc-actions { display: flex; gap: 8px; }

/* ---- Inicio compacto ---- */
.home-top { margin-bottom: 12px; }
.home-top h1 { font-size: 22px; }
.home-clock { padding: 8px 16px; border-radius: 12px; }
.home-clock .hc-date { font-size: 17px; }
.home-clock .hc-time { font-size: 28px; }
.home-sec { padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; }
.home-h { font-size: 15px; margin-bottom: 8px; }
.home-notices { border: 2px solid var(--brand); background: #fff; box-shadow: 0 3px 12px rgba(11,82,150,.12); }
.home-notices .home-h { font-size: 19px; }
.home-notices .home-msg { padding: 12px 16px; }
.home-notices .hm-title { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.home-notices .hm-body { font-size: 15px; }
.home-compact .muted, .home-compact small { font-size: 12px; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.chip-group { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); min-width: 92px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.chip-link svg { width: 15px; height: 15px; fill: none; stroke: var(--brand); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chip-link:hover { border-color: var(--brand); background: var(--brand-light); }
.home-cols { gap: 12px; }
.svc-row { padding: 5px 0; }
.svc-time { font-size: 15px; min-width: 70px; }
.online-row { padding: 4px 0; }
.fare-acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; }
.fare-acc > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 14px; }
.fare-acc[open] > summary { border-bottom: 1px solid var(--line); }
.fare-acc .fare-table { margin: 4px 8px 8px; width: calc(100% - 16px); }

/* ---- Inicio: accesos azules, banner y calendario ---- */
.tiles-blue { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tile-blue { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 92px; padding: 12px 8px; border-radius: 14px; background: var(--brand); color: #fff; text-decoration: none; box-shadow: 0 2px 6px rgba(11,82,150,.25); transition: transform .12s, box-shadow .12s, filter .12s; }
.tile-blue svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile-blue span { font-size: 13px; font-weight: 600; line-height: 1.2; color: #fff; }
.tile-blue:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(11,82,150,.35); filter: brightness(1.08); }
.home-banner { margin-bottom: 12px; }
.home-banner img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.home-side { display: flex; flex-direction: column; }
.mini-cal { font-size: 12px; }
.mc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mc-head button { border: 0; background: var(--brand-light); color: var(--brand); border-radius: 6px; width: 26px; height: 26px; font-size: 16px; cursor: pointer; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mc-dow { color: var(--muted); font-weight: 700; font-size: 10.5px; padding: 2px 0; }
.mc-day { padding: 4px 0; border-radius: 6px; }
.mc-day.is-wk { color: var(--muted); }
.mc-day.is-today { background: var(--brand); color: #fff; font-weight: 700; }


/* ---- Compra pública: banner al pie, acordeón de cupones, aceptación, RUT, guardar boleto ---- */
.pub-banner { margin-top: 8px; margin-bottom: 20px; }
.pub-banner img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; }
.co-acc > summary { list-style: none; cursor: pointer; }
.co-acc > summary::-webkit-details-marker { display: none; }
.co-acc .co-chev { transition: transform .2s; font-size: 18px; }
.co-acc[open] .co-chev { transform: rotate(180deg); }
.consent { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line, #dfe5ec); border-radius: 12px; background: #f8fafc; cursor: pointer; font-size: 12.5px; line-height: 1.5; color: var(--muted, #5b6776); margin: 0; }
.consent input[type=checkbox] { flex: 0 0 auto; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; }
.consent span { flex: 1 1 auto; min-width: 0; }
.consent a { color: var(--brand); font-weight: 600; }
.rut-row { display: flex; gap: 8px; align-items: stretch; }
.rut-row input { flex: 1 1 auto; min-width: 0; }
.rut-k { flex: 0 0 auto; min-width: 48px; border: 1px solid var(--brand); background: var(--brand-light); color: var(--brand); font-weight: 800; font-size: 18px; border-radius: 10px; cursor: pointer; }
.rut-toggle { border: 0; background: none; color: var(--brand); font-size: 12px; padding: 4px 0 0; cursor: pointer; text-decoration: underline; }
.ticket-save { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 14px 0; }
.ticket-save .btn { padding: 8px 14px; font-size: 13px; }
.tickets-saveall { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media print { .pub-banner, .ticket-save, .tickets-saveall { display: none !important; } }

/* Teclado propio para el RUT (celular) y menú de compartir */
.rut-wrap input { width: 100%; }
body.rut-pad-open { padding-bottom: 290px; }
.rut-pad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: #d9dee5; box-shadow: 0 -4px 14px rgba(0,0,0,.18); }
.rut-pad.is-open { display: grid; }
.rut-pad button { height: 52px; font-size: 24px; font-weight: 600; border: 0; border-radius: 10px; background: #fff; color: #1f2937; box-shadow: 0 1px 0 rgba(0,0,0,.25); touch-action: manipulation; }
.rut-pad button:active { background: #e8eef6; }
.rut-pad .is-k { background: var(--brand-light, #e7eff8); color: var(--brand); font-weight: 800; }
.rut-pad .rut-done { grid-column: 1 / -1; height: 46px; font-size: 17px; background: var(--brand); color: #fff; }
.share-menu { display: flex; gap: 8px; margin-top: 10px; }
.share-menu[hidden] { display: none; }
.share-menu .btn { text-decoration: none; }
@media print { .rut-pad, .share-menu { display: none !important; } }

/* Fase 40: tablas anchas se deslizan en horizontal sin ensanchar la pantalla */
.main .card { min-width: 0; max-width: 100%; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll table { min-width: 640px; }
.table-scroll th, .table-scroll td { white-space: nowrap; }

/* Fase 41: Cambiar pasaje y Anular en la misma línea */
.ticket-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px 14px; }
.ticket-btns form { margin: 0; padding: 0; }
