@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #F6F7F9; --card: #FFFFFF; --ink: #0F1B2D; --muted: #5B6676; --line: #E4E7EC; --soft: #EEF1F6;
  --primary: #0B4870; --primary-dark: #083656; --primary-soft: #E6EFF6;
  --brand-red: #C82028; --brand-navy-deep: #082F4B;
  --ok: #0B7A4B; --ok-bar: #1F9D6B; --ok-soft: #E6F6EE;
  --warn: #8A5300; --warn-bar: #E8A317;
  --danger: #B3202F; --danger-soft: #FDECEE;
  --shadow: 0 8px 24px rgba(15, 27, 45, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink);
  min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; width: 100%; }
main.container { flex: 1; padding-top: 32px; padding-bottom: 56px; }

/* Topbar */
.topbar { background: #fff; border-bottom: 4px solid var(--brand-red); }
.topbar .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--ink); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; text-decoration: none; }
.brand-logo { height: 54px; width: auto; display: block; }
.brand-tag { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--brand-red); border-radius: 6px; padding: 3px 8px; }
body.admin .brand-logo { background: #fff; border-radius: 10px; padding: 3px 10px; height: 50px; }
.login-logo { display: block; height: 96px; width: auto; margin: 0 auto 16px; }
.contract-doc .c-logo { display: block; height: 58px; width: auto; margin: 0 auto 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
nav a, .linkbtn { color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; padding: 10px 14px; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
nav a:hover, .linkbtn:hover { color: var(--ink); background: var(--soft); }
nav a.on { color: var(--ink); background: var(--soft); }
body.admin .topbar { background: var(--brand-navy-deep); }
body.admin .brand { color: #fff; }
body.admin nav a, body.admin .linkbtn { color: #C5CEDD; }
body.admin nav a:hover, body.admin .linkbtn:hover { color: #fff; background: rgba(255,255,255,.1); }
body.admin nav a.on { color: #fff; background: rgba(255,255,255,.14); }
form.inline { display: inline; margin: 0; }

/* Tipografia */
h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; margin: 0 0 20px; }
h2 { font-size: 1.15rem; letter-spacing: -.02em; font-weight: 800; margin: 0 0 14px; }
.eyebrow { margin: 0 0 12px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-red); }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: 2.9rem; max-width: 640px; margin-bottom: 14px; }
.hero p.lead { margin: 0; font-size: 1.1rem; color: var(--muted); max-width: 560px; }
.muted, .empty { color: var(--muted); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 420px; margin: 40px auto; box-shadow: var(--shadow); }
.card.center { text-align: center; max-width: 560px; margin: 24px auto; box-shadow: var(--shadow); }
.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.two-col > .card { flex: 1 1 340px; min-width: 0; margin-bottom: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 36px 0 18px; }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.section-head span { color: var(--muted); font-size: .9rem; font-weight: 600; }

/* Busca */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; margin: 28px 0 0; box-shadow: var(--shadow); align-items: stretch; }
.filters label { flex: 1 1 220px; margin: 0; padding: 6px 14px; display: flex; flex-direction: column; gap: 2px; font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.filters label + label { border-left: 1px solid var(--line); }
.filters input, .filters select { border: 0; background: transparent; padding: 6px 0; min-height: 32px; font-size: 1rem; font-weight: 600;
  letter-spacing: 0; text-transform: none; margin: 0; }
.filters input:focus, .filters select:focus { outline: 0; }
.filters label:focus-within { background: var(--soft); border-radius: 12px; }
.filters .btn { min-height: 52px; }

/* Viagens */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.trip { margin: 0; padding: 22px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 1px 2px rgba(15,27,45,.04); }
.trip-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; }
.trip-date { font-size: .88rem; font-weight: 700; color: var(--muted); }
.tag { display: inline-block; background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 700; }
.legs { display: flex; align-items: center; gap: 14px; }
.leg { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.leg.end { align-items: flex-end; text-align: right; }
.leg b { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.leg span { font-size: .88rem; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.line { flex: 1; min-width: 36px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.line small { font-size: .75rem; font-weight: 700; color: var(--muted); }
.line i { display: block; width: 100%; height: 2px; background: #D3D9E3; border-radius: 2px; }
.seatbar { display: flex; flex-direction: column; gap: 8px; }
.seatbar .row { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 700; color: var(--muted); }
.seats { color: var(--ok); } .seats.low { color: var(--warn); }
.bar-track { height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.bar-fill { height: 6px; border-radius: 6px; background: var(--ok-bar); }
.bar-fill.low { background: var(--warn-bar); }
.trip-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--soft); }
.price { display: flex; flex-direction: column; }
.price b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.price small { font-size: .75rem; color: var(--muted); font-weight: 600; }

/* Resumo / reserva */
.timeline { display: flex; gap: 16px; margin: 18px 0; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.timeline .dot { width: 12px; height: 12px; border-radius: 12px; border: 3px solid var(--primary); }
.timeline .dot.fill { background: var(--primary); }
.timeline .rail i { flex: 1; width: 2px; background: #D3D9E3; margin: 4px 0; }
.timeline .stops { display: flex; flex-direction: column; gap: 26px; }
.timeline .stops b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.timeline .stops span { color: var(--muted); font-weight: 600; }
.stat-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--bg); border-radius: 12px; padding: 14px; }
.stat small { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.stat b { font-size: 1.25rem; font-weight: 800; }
.total { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: 14px; background: var(--bg); margin: 4px 0 16px; color: var(--muted); font-weight: 600; }
.total strong { font-size: 1.6rem; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.code { font-family: ui-monospace, "Cascadia Mono", monospace; background: var(--soft); padding: 2px 10px; border-radius: 8px; }
.back { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--ink); }

/* Formulários */
label { display: block; font-size: .85rem; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 600; min-height: 44px; }
input, select { display: block; width: 100%; margin-top: 6px; min-height: 48px; padding: 0 14px; font: inherit; font-weight: 500; color: var(--ink);
  border: 1px solid #C9D0DC; border-radius: 12px; background: #fff; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--primary); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; border: 1px solid var(--primary);
  border-radius: 12px; padding: 0 22px; min-height: 44px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border-color: #C9D0DC; }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.danger { background: #fff; color: var(--danger); border-color: #F0B6BE; }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .85rem; border-radius: 9px; }
.btn.block { display: flex; width: 100%; min-height: 52px; font-size: 1rem; }
.btn:disabled { background: var(--soft); color: var(--muted); border-color: var(--soft); cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 14px 0 0; }
form .actions { justify-content: flex-start; }
.alert.warn { background: #FFF6E0; color: #8A5A00; border-color: #F5C26B; }
.alert { background: var(--danger-soft); color: #8C1322; border: 1px solid #F3B8C0; padding: 10px 14px; border-radius: 12px; margin: 10px 0; font-weight: 600; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
/* Painel do admin */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: block; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--primary); border-radius: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.kpi:hover { box-shadow: var(--shadow); }
.kpi small { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.kpi b { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.kpi span { display: block; font-size: .78rem; color: var(--muted); }
.chart-box { position: relative; height: 280px; margin-top: 12px; }
.chart-box.small { height: 220px; }
.legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
table.list { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; padding: 12px 14px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
table.list td { text-align: left; padding: 14px; border-top: 1px solid var(--soft); vertical-align: top; }
.row-actions { white-space: nowrap; display: flex; gap: 6px; }
.btn.icon { width: 36px; padding: 0; display: inline-grid; place-items: center; flex: none; }
td.actions-cell { position: sticky; right: 0; background: #fff; box-shadow: -8px 0 8px -8px rgba(15,27,45,.18); }
tr.attention td.actions-cell { background: #FFF6E0; }
th.actions-col { position: sticky; right: 0; background: #fff; }
table.kv { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
table.kv th, table.kv td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
table.kv th { width: 38%; background: var(--bg); font-weight: 700; }

/* Contrato */
.contract { max-width: 800px; margin: 0 auto 20px; }
.contract h1 { font-size: 1.5rem; text-align: center; }
.clauses li { margin-bottom: 6px; }
.signs { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; text-align: center; }
.signs div { flex: 1; border-top: 1px solid var(--ink); padding-top: 8px; }
.foot { color: var(--muted); font-size: .85rem; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid var(--line); background: #fff; max-width: none; }

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.6rem; }
  .filters { flex-direction: column; }
  .filters label + label { border-left: 0; border-top: 1px solid var(--line); }
  .filters .btn { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .signs { flex-direction: column; }
  .trip-foot .btn { min-height: 48px; }
}
@media print {
  .topbar, .foot, .no-print { display: none !important; }
  body { background: #fff; } .card { border: 0; padding: 0; box-shadow: none; }
}

/* Linhas universitárias */
.step-label { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
[hidden] { display: none !important; }
.line-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700; background: var(--soft); color: #5F6B7C; }
.chip.on { background: var(--primary-soft); color: var(--primary-dark); }
fieldset.days { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
fieldset.days legend { font-size: .85rem; font-weight: 700; padding: 0 6px; }
fieldset.days label { margin-bottom: 8px; }

/* Planos de parcelamento */
.plans-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.plans-mini span { font-size: .78rem; padding: 4px 10px; border-radius: 8px; background: var(--soft); color: var(--ink); font-weight: 600; }
.plans-mini b { color: var(--primary-dark); }
.plan-options { display: grid; gap: 10px; margin: 0 0 16px; }
.plan-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #C9D0DC; border-radius: 12px; cursor: pointer; margin: 0; background: #fff; }
.plan-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.plan-option input { margin: 0; flex: none; }
.plan-option .pn { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; min-width: 3.2ch; }
.plan-option .pv { font-weight: 700; }
.plan-option small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; }
.place { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 16px; background: var(--bg); }
.place h3 { margin: 0 0 8px; font-size: 1rem; }
.place label { margin-bottom: 10px; }
.place .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.place .picked { font-size: .82rem; color: var(--ok); font-weight: 700; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 500; margin: -8px 0 14px; }
.cep-status { font-size: .8rem; font-weight: 600; margin-top: 4px; color: var(--muted); min-height: 1.2em; }
.plan-row { display: grid; grid-template-columns: 90px 140px 140px 1fr auto; gap: 10px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--bg); }
.plan-row label { margin: 0; }
.plan-row .months { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.plan-row .months input { width: 150px; margin: 0; }
@media (max-width: 760px) { .plan-row { grid-template-columns: 1fr 1fr; } .plan-row .months-wrap, .plan-row .rm { grid-column: 1 / -1; } }

/* Mapa (seletor de local) */
.nav-badge { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #F59E0B; color: #fff; font-size: .75rem; font-weight: 800; text-align: center; line-height: 20px; }
tr.attention td { background: #FFF6E0; }
.map-notice { margin: 0; padding: 8px 14px; background: #FFF6E0; color: #8A5A00; font-size: .84rem; font-weight: 600; border-top: 1px solid #F5C26B; border-bottom: 1px solid #F5C26B; }
.map-modal { position: fixed; inset: 0; background: rgba(15,27,45,.55); display: grid; place-items: center; z-index: 50; padding: 12px; }
.map-box { background: #fff; border-radius: 16px; width: min(760px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.map-head { padding: 14px 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); }
.map-head input { flex: 1 1 220px; margin: 0; }
.map-canvas { height: min(55vh, 420px); width: 100%; }
.map-foot { padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); }
.map-foot .addr { flex: 1 1 240px; font-size: .9rem; font-weight: 600; min-height: 1.3em; }

.aid-choice { border: 0; padding: 0; margin: 0 0 12px; }
.aid-choice legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.plans-mini em { font-style: normal; color: var(--ok); font-weight: 700; }

/* Card de linha: nome em destaque, dias numa linha, valores sob demanda */
.line-banner { background: var(--primary); color: #fff; text-align: center; font-weight: 800; font-size: 1.1rem; letter-spacing: .01em;
  line-height: 1.3; padding: 12px 14px; border-radius: 12px; overflow-wrap: anywhere; }
.line-sub { text-align: center; color: var(--muted); font-size: .88rem; font-weight: 600; margin-top: -8px; }
.line-sub em { display: inline-block; margin-top: 3px; font-style: italic; font-size: 1rem; font-weight: 800; color: var(--primary); }
.chips.one-line { flex-wrap: nowrap; justify-content: center; gap: 6px; }
.chips.one-line .chip { flex: 0 1 auto; white-space: nowrap; }
details.values { border: 0; }
details.values > summary { list-style: none; display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
details.values > summary::-webkit-details-marker { display: none; }
details.values > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
details.values[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.values .t-close, details.values[open] .t-open { display: none; }
details.values[open] .t-close { display: inline; }
.values-body { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
table.plans-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.plans-table th { text-align: left; color: var(--muted); font-size: .7rem; letter-spacing: .03em; text-transform: uppercase; padding: 4px 4px 6px; }
table.plans-table td { padding: 7px 4px; white-space: nowrap; border-top: 1px solid var(--line); vertical-align: top; }
table.plans-table td.aid { color: var(--ok); font-weight: 700; }

table.plans-table td:last-child { white-space: normal; }
details.values .table-wrap { overflow-x: visible; }

.tag.soldout { background: var(--danger-soft); color: var(--danger); }
.trip.is-soldout .line-banner { background: #5B6676; }
.trip.is-soldout .chip.on { background: var(--soft); color: var(--muted); }

/* ===== Elementos novos (no desktop não mudam o layout) ===== */
.menu-toggle { display: none; }
.menu-toggle .i-close { display: none; }
.filter-actions, .card-bottom { display: contents; }
.brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Celular (até 640px): menu compacto, busca enxuta, cards densos ===== */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .topbar { position: sticky; top: 0; z-index: 30; }
  .topbar .bar { flex-wrap: nowrap; min-height: 56px; padding-top: 0; padding-bottom: 0; gap: 8px; }
  .brand { font-size: 1.05rem; min-width: 0; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; flex: none; }
  .brand-mark svg { width: 18px; height: 18px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin-right: -8px;
    border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; }
  .menu-toggle:hover, .topbar.nav-open .menu-toggle { background: var(--soft); }
  body.admin .menu-toggle { color: #fff; }
  body.admin .menu-toggle:hover, body.admin .topbar.nav-open .menu-toggle { background: rgba(255,255,255,.12); }
  .topbar.nav-open .menu-toggle .i-open { display: none; }
  .topbar.nav-open .menu-toggle .i-close { display: block; }
  .topbar nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 8px 12px 12px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 14px 28px rgba(15,27,45,.14); }
  body.admin .topbar nav { background: var(--brand-navy-deep); border-bottom-color: rgba(255,255,255,.12); }
  .topbar.nav-open nav { display: flex; }
  .topbar nav a, .topbar nav .linkbtn { min-height: 48px; width: 100%; padding: 0 14px; font-size: 1rem; justify-content: flex-start; border-radius: 12px; }
  form.inline { display: block; }

  main.container { padding-top: 14px; padding-bottom: 28px; }
  h1 { font-size: 1.4rem; margin-bottom: 14px; }
  .card { padding: 14px; margin-bottom: 14px; }

  /* Título + busca */
  .eyebrow, .hero p.lead { display: none; }
  .hero { padding: 4px 0 0; }
  .hero h1 { font-size: 1.4rem; line-height: 1.2; margin-bottom: 0; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; margin: 12px 0 0; border-radius: 14px; }
  .filters label, .filters label + label { flex: none; margin: 0; padding: 0; border: 0; gap: 2px; font-size: .66rem; }
  .filters label:focus-within { background: transparent; }
  .filters input, .filters select { min-height: 40px; padding: 0 10px; border: 1px solid #D5DAE3; border-radius: 10px; background: #fff; font-size: 1rem; }
  .filters input:focus, .filters select:focus { outline: 2px solid var(--primary); outline-offset: 0; }
  .filter-actions { display: flex; gap: 8px; grid-column: 1 / -1; }
  .filter-actions .btn { flex: 1; min-height: 44px; width: auto; }
  .section-head { margin: 20px 0 10px; }
  .section-head h2 { font-size: 1.1rem; }

  /* Cards */
  .grid { gap: 12px; }
  .trip { padding: 12px; gap: 9px; margin-bottom: 0; }
  .trip-top { min-height: 0; }
  .trip-date { font-size: .78rem; }
  .tag { font-size: .7rem; padding: 2px 9px; }
  .line-banner { font-size: .92rem; padding: 9px 10px; border-radius: 10px; }
  .line-sub { font-size: .76rem; margin-top: -3px; }
  .chips { gap: 5px; }
  .chip { font-size: .7rem; padding: 2px 8px; border-radius: 7px; }
  .stat-pair { gap: 0; background: var(--bg); border-radius: 10px; margin: 0; }
  .stat-pair .stat { background: transparent; padding: 7px 10px; border-radius: 0; }
  .stat-pair .stat + .stat { border-left: 1px solid var(--line); }
  .stat small { font-size: .62rem; }
  .stat b { font-size: 1.05rem; }
  .line-start { display: none; }
  details.values > summary { min-height: 40px; font-size: .88rem; }
  .values-body { margin-top: 8px; padding: 8px 10px; }
  .card-bottom { display: flex; align-items: center; gap: 10px; }
  .card-bottom .seatbar { flex: 1; min-width: 0; gap: 4px; }
  .card-bottom .seatbar .row { font-size: .75rem; }
  .bar-track, .bar-fill { height: 5px; }
  .card-bottom .trip-foot { flex: none; padding: 0; border: 0; }
  .card-bottom .btn.block { width: auto; min-height: 44px; padding: 0 20px; font-size: .95rem; }
  /* viagens avulsas */
  .legs { gap: 10px; }
  .leg b { font-size: 1.35rem; }
  .leg span { font-size: .78rem; }
  .trip-foot { padding-top: 10px; }
  .price b { font-size: 1.2rem; }

  /* Linhas da home: carrossel horizontal (mostra um pedaço do próximo card) */
  .grid.h-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; align-items: flex-start;
    margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .grid.h-scroll::-webkit-scrollbar { display: none; }
  .grid.h-scroll > .card { flex: 0 0 88%; scroll-snap-align: start; }
  .grid.h-scroll > .card:only-child { flex-basis: 100%; }
  .foot { padding-top: 14px; padding-bottom: 18px; }
}

@media (max-width: 640px) {
  .enroll-plans { display: none; }   /* os valores aparecem na etapa 3 do formulário */
  .two-col { gap: 14px; }
}

@media (max-width: 640px) {
  .chips, .chips.one-line { gap: 4px; }
  .chip { padding: 2px 7px; }
  .grid.h-scroll { overscroll-behavior-x: contain; }
  .timeline .stops b, .total strong { font-size: 1.3rem; }
  .card.narrow, .card.center { margin: 16px auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.foot-row a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 0; min-height: 44px; display: inline-flex; align-items: center; }
.foot-row a:hover { color: var(--ink); text-decoration: underline; }

/* ===== Busca no cabeçalho + cabeçalho da página ===== */
.topbar { position: relative; }
.page-head { padding: 4px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { margin: 0; }
.active-filters { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; color: var(--muted); font-size: .9rem; font-weight: 600; }
.active-filters a { margin-left: 4px; font-weight: 700; }
.search-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; flex: none; }
.search-toggle:hover, .topbar.search-open .search-toggle { background: var(--soft); }
.topbar nav { margin-left: auto; }
.search-panel { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 40; background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 28px rgba(15,27,45,.14); padding: 14px 0; }
.topbar.search-open .search-panel { display: block; }
.search-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 12px; align-items: end; }
.search-form label { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.search-form input, .search-form select { margin-top: 4px; min-height: 44px; font-size: 1rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.search-actions { display: flex; gap: 8px; }
.search-actions .btn { min-height: 44px; }
@media (max-width: 640px) {
  .search-toggle { width: 44px; padding: 0; justify-content: center; border-color: transparent; background: transparent; margin-left: auto; }
  .search-toggle .lbl { display: none; }
  .topbar nav { margin-left: 0; }
  .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .search-form label { font-size: .66rem; }
  .search-form input, .search-form select { min-height: 40px; padding: 0 10px; border: 1px solid #D5DAE3; border-radius: 10px; }
  .search-actions { grid-column: 1 / -1; }
  .search-actions .btn { flex: 1; min-height: 44px; }
  .page-head h1 { font-size: 1.4rem; }
  .menu-toggle { margin-left: 0; }
}
@media (min-width: 641px) {
  .topbar nav { order: 2; }
  .search-toggle { order: 3; }
}

/* ===== Contratação: resumo compacto, erros por campo, data digitável, planos por cor ===== */
.enroll > .enroll-summary { flex: 0 1 300px; display: flex; flex-direction: column; gap: 10px; }
.enroll > .card:not(.enroll-summary) { flex: 1 1 420px; }
.enroll-summary .trip-date { font-size: .85rem; }
.enroll-summary .chips { justify-content: center; }
.enroll-summary .stat-pair { margin: 0; }
.field-error { display: block; margin-top: 4px; color: var(--danger); font-size: .8rem; font-weight: 700; line-height: 1.3; }
.field-error[hidden] { display: none; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); background: #FFF8F8; }
.plan-options > .field-error, fieldset > .field-error { grid-column: 1 / -1; }
.date-wrap { position: relative; display: block; margin-top: 6px; }
.date-wrap > input[name] { margin-top: 0; padding-right: 48px; }
.date-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.date-btn:hover { background: var(--soft); color: var(--ink); }
.date-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* planos: tom verde = com auxílio, tom âmbar = sem auxílio */
#plans-box[data-mode="yes"] .plan-option { background: #F1FAF5; border-color: #A9DDC4; }
#plans-box[data-mode="yes"] .plan-option:has(input:checked) { background: #DDF3E8; border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
#plans-box[data-mode="yes"] .plan-option .pv { color: #0B6B42; }
#plans-box[data-mode="no"] .plan-option { background: #FFF9EC; border-color: #F0D79B; }
#plans-box[data-mode="no"] .plan-option:has(input:checked) { background: #FFEFC9; border-color: #C98A00; box-shadow: 0 0 0 1px #C98A00; }
#plans-box[data-mode="no"] .plan-option .pv { color: #8A5300; }
#plans-box .plan-option input { accent-color: currentColor; }
.aid-choice .plan-option:has(input[value="yes"]:checked) { background: #DDF3E8; border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.aid-choice .plan-option:has(input[value="no"]:checked) { background: #FFEFC9; border-color: #C98A00; box-shadow: 0 0 0 1px #C98A00; }
@media (max-width: 640px) {
  .enroll > .enroll-summary { flex: 1 1 auto; padding: 12px; gap: 8px; margin-bottom: 0; }
}

fieldset.guardian { border: 1px solid #F5C26B; border-left: 5px solid #F59E0B; border-radius: 12px; padding: 12px 14px 2px; margin: 0 0 16px; background: #FFF6E0; }
fieldset.guardian legend { font-size: .85rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: #F59E0B; color: #fff; }
fieldset.guardian .hint { color: #8A5A00; }
fieldset.guardian[hidden] { display: none; }

.contract-doc { font-family: "Times New Roman", Georgia, serif; font-size: 1.05rem; line-height: 1.6; padding: 36px 44px; }
.contract-doc h1 { font-size: 1.25rem; margin: 0 0 18px; letter-spacing: .02em; }
.contract-doc h2 { font-size: 1rem; text-decoration: underline; margin: 22px 0 8px; font-weight: 700; }
.contract-doc p { margin: 0 0 12px; text-align: justify; }
.contract-doc .c-line { text-align: left; padding-left: 20px; margin-bottom: 6px; }
.contract-doc .c-date { text-align: center; margin: 24px 0 8px; }
.contract-doc .signs { flex-wrap: wrap; margin-top: 40px; justify-content: center; }  /* a assinatura que sobra (responsável) fica no centro, abaixo */
.contract-doc .signs div { flex: 1 1 40%; max-width: calc(50% - 12px); border-top: 1px solid var(--ink); }
@media (max-width: 640px) { .contract-doc { padding: 22px 18px; } }

/* Impressão do contrato pela tela: cabe em uma folha, frente e verso */
@media print {
  @page { size: A4; margin: 1.5cm; }
  .contract-doc { font-size: 10pt; line-height: 1.32; padding: 0; border: 0; box-shadow: none; max-width: none; }
  .contract-doc h1 { font-size: 12.5pt; margin: 0 0 8px; }
  .contract-doc .c-logo { height: 44px; margin-bottom: 6px; }
  .contract-doc h2 { font-size: 10.5pt; margin: 9px 0 4px; break-after: avoid; }
  .contract-doc p { margin: 0 0 5px; }
  .contract-doc .signs { margin-top: 18px; break-inside: avoid; }
}

/* Rodapé: crédito do desenvolvedor */
.foot-row a.dev { gap: 10px; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.foot-row a.dev img { height: 28px; width: auto; display: block; }
.foot-row a.dev:hover { text-decoration: none; opacity: .85; }
.foot.foot-dark { background: #303E4B; border-top: 0; color: #C5CEDD; }
.foot.foot-dark .foot-row a { color: #C5CEDD; }
.foot.foot-dark .foot-row a:hover { color: #fff; }
@media (max-width: 640px) {
  .foot-row { flex-direction: column; align-items: center; text-align: center; gap: 2px; }
  .foot-row a.dev { order: 3; padding: 10px 0; min-height: 0; }
  .foot-row a[href="/admin"] { order: 2; }
}

/* ===== Rotas: horário único, obrigatórios, WhatsApp, CEP, contato, documentos ===== */
.stat-pair.single { grid-template-columns: 1fr; text-align: center; }
.stat-pair.single .stat b { font-size: 1.4rem; letter-spacing: .01em; }
.req { color: var(--danger); font-weight: 800; }
label.wa-check { margin: -6px 0 14px; min-height: 0; font-size: .85rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--primary); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--primary-dark); }
.cep-help { margin: -4px 0 12px; }
.cep-form { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 12px 16px; }
.cep-form input { margin: 0; }
.cep-form input[type=search], .cep-form button { grid-column: 1 / -1; }
.cep-results { overflow-y: auto; max-height: min(45vh, 360px); display: grid; gap: 6px; padding: 0 16px 10px; }
.btn.cep-item { display: grid; justify-items: start; text-align: left; height: auto; padding: 8px 12px; line-height: 1.3; gap: 0; }
.cep-item span { color: var(--muted); font-weight: 600; font-size: .8rem; }
.cep-item em { font-style: normal; color: var(--primary); font-weight: 700; font-size: .82rem; }
.contact-banner { margin: 6px 0 16px; padding: 18px 16px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; gap: 6px; }
.contact-banner strong { font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; line-height: 1.15; }
.contact-banner span { font-size: .9rem; font-weight: 600; opacity: .92; }
.share-box { margin: 14px 0 6px; padding: 14px; border: 1px dashed #C9D0DC; border-radius: 14px; background: var(--bg); }
.share-box .actions { margin: 0; justify-content: center; }
.docs-card { max-width: 640px; margin-left: auto; margin-right: auto; box-shadow: var(--shadow); }
.doc-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: var(--bg); }
.doc-item.done { border-color: #A9DDC4; background: #F1FAF5; }
.doc-item h2 { margin: 0 0 8px; font-size: 1.05rem; }
.doc-item .actions { justify-content: flex-start; margin: 8px 0 0; }
.doc-files { list-style: none; margin: 0; padding: 0; font-size: .88rem; font-weight: 600; color: var(--ok); overflow-wrap: anywhere; }
.doc-status { margin: 8px 0 0; font-size: .85rem; font-weight: 700; color: var(--muted); min-height: 1.2em; }
.doc-status.err { color: var(--danger); }
/* dados que vão para o contrato aparecem (e são gravados) em MAIÚSCULAS */
input[name=passenger_name], input[name=rg], input[name=street], input[name=number], input[name=complement], input[name=district], input[name=city],
input[name=boarding_address], input[name=alighting_address], input[name=guardian_name], input[name=guardian_rg], input[name=referred_by], #s1_name { text-transform: uppercase; }
/* convite para instalar o app (PWA) */
.pwa-banner { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; display: grid;
  grid-template-columns: 44px 1fr; gap: 10px 12px; align-items: center; padding: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 27, 45, .22); max-width: 560px; margin: 0 auto; }
.pwa-banner img { width: 44px; height: 44px; border-radius: 10px; }
.pwa-text { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.pwa-text strong { font-size: .95rem; }
.pwa-text span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pwa-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.pwa-actions .btn { min-height: 44px; }
body.has-pwa-banner { padding-bottom: 120px; }
/* perguntas finais do cadastro (como nos encontrou / indicação) */
fieldset.survey { border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px 4px; margin: 0 0 16px; background: var(--bg); }
fieldset.survey legend { font-size: .85rem; font-weight: 800; padding: 0 8px; color: var(--primary-dark); }
fieldset.survey label.check { min-height: 40px; margin-bottom: 4px; }
fieldset.survey .survey-field { margin: 0 0 12px 30px; }
/* aviso rápido (admin) */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: #0F1B2D; color: #fff; padding: 12px 20px;
  border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(15, 27, 45, .3); max-width: calc(100% - 32px); }
/* preview completo do contrato (admin) */
.ct-preview { position: fixed; inset: 0; z-index: 60; background: rgba(15, 27, 45, .6); display: grid; place-items: center; padding: 12px; }
.ct-preview-box { background: var(--bg); border-radius: 16px; width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ct-preview-head { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.ct-preview-head strong { flex: 1 1 0; font-size: 1.05rem; order: 1; }
.ct-pv-actions { order: 2; display: flex; gap: 8px; flex-wrap: wrap; }
.ct-pv-opts { display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center; flex: 1 1 100%; order: 3; }
.ct-pv-opts label { margin: 0; font-size: .82rem; }
.ct-pv-opts select { margin: 0 0 0 6px; min-height: 36px; width: auto; display: inline-block; }
.ct-pv-opts label.check { min-height: 36px; }
.ct-preview-body { overflow-y: auto; padding: 16px; outline: 0; }
.ct-preview-body .contract-doc { margin: 0 auto; }
/* "Imprimir" do preview: com a janela aberta, sai só o contrato (o resto da tela some; mesmas regras de impressão do contrato) */
@media print {
  body.pv-open > *:not(.ct-preview) { display: none !important; }
  body.pv-open { padding: 0 !important; background: #fff; }
  body.pv-open .ct-preview { position: static; display: block; background: none; padding: 0; }
  body.pv-open .ct-preview-box { display: block; background: #fff; border-radius: 0; width: auto; max-height: none; overflow: visible; }
  body.pv-open .ct-preview-head, body.pv-open #pv-note { display: none !important; }
  body.pv-open .ct-preview-body { overflow: visible; padding: 0; }
}
/* editor do modelo do contrato (admin) */
.ct-bar { position: sticky; top: 0; z-index: 6; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 14px; box-shadow: var(--shadow); }
.ct-bar input { flex: 1 1 220px; margin: 0; min-height: 40px; }
.ct-tools { display: inline-flex; gap: 6px; }
.ct-doc { padding: 24px 32px; }
.ct-block { position: relative; margin: 0 0 10px; padding: 4px 8px 6px 10px; border-left: 3px solid transparent; border-radius: 4px; }
.ct-block:hover, .ct-block:focus-within { background: #FAFBFD; }
.ct-block.dirty { border-left-color: #F59E0B; }
.ct-block.invalid { border-left-color: var(--danger); background: #FFF8F8; }
.ct-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font: 700 .68rem/1.4 "Manrope", system-ui, sans-serif; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.ct-when { background: #FFF6E0; color: #8A5A00; border-radius: 999px; padding: 0 8px; letter-spacing: 0; text-transform: none; font-weight: 700; }
.ct-meta .link-btn { margin-left: auto; font-size: .72rem; text-transform: none; letter-spacing: 0; }
.ct-edit { outline: 0; white-space: pre-wrap; min-height: 1.5em; padding: 2px 4px; border-radius: 6px; text-align: justify; line-height: 1.75; }
.ct-edit:focus { background: #FFFDF2; box-shadow: 0 0 0 2px var(--primary-soft); }
.ct-title .ct-edit { text-align: center; font-weight: 700; font-size: 1.15rem; }
.ct-notice .ct-edit { text-align: center; background: #FFF6E0; color: #9A5B00; font-size: .95rem; }
.ct-h .ct-edit { font-weight: 700; text-decoration: underline; text-align: left; }
.ct-line .ct-edit { text-align: left; padding-left: 20px; }
.ct-warn { color: var(--danger); font: 700 .8rem/1.4 "Manrope", system-ui, sans-serif; margin-top: 2px; }
.ct-frag { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
.ct-frag .ct-edit { background: #fff; border: 1px solid var(--line); }
.vchip { display: inline; background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #BFD3E3; border-radius: 6px; padding: 0 5px; margin: 0 1px;
  font-weight: 700; font-size: .92em; cursor: grab; user-select: all; white-space: normal; }
.vchip.frag { background: #FFF6E0; color: #8A5A00; border: 1px dashed #E8A317; font-weight: 600; }
@media (max-width: 640px) { .ct-doc { padding: 14px 10px; } }
/* verificação do WhatsApp (pós-aceite) e listas simples do admin */
.verify-box { margin: 6px 0 16px; padding: 16px; border: 1px solid #A9DDC4; border-radius: 14px; background: #F1FAF5; text-align: left; }
.verify-box h2 { margin: 0 0 6px; font-size: 1.05rem; }
.verify-box p { margin: 0 0 10px; font-size: .92rem; }
.verify-form { display: flex; gap: 8px; margin-bottom: 6px; }
.verify-form input { margin: 0; letter-spacing: .35em; font-size: 1.3rem; font-weight: 800; text-align: center; max-width: 11em; }
.verify-ok { margin: 0; font-weight: 800; color: var(--ok); text-align: center; font-size: 1.05rem; }
ul.plain-list { margin: 0 0 8px; padding-left: 18px; font-size: .9rem; }
ul.plain-list li { margin-bottom: 4px; }
/* admin: análise da contratação */
.docs-panel { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); }
.docs-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.docs-panel .checks { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.docs-panel .link-out { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.docs-panel .link-out input { flex: 1 1 260px; margin: 0; min-height: 40px; }
.docs-req { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; font-size: .88rem; }
.docs-req ul { margin: 6px 0; padding-left: 18px; }
