/* Rendiciones Zeki — estilos. Paleta tomada del logo oficial de Zeki Transportes SpA. */
:root {
  --azul: #0073a4;        /* símbolo */
  --azul-osc: #08466a;    /* sombra del símbolo */
  --celeste: #4890b6;     /* flecha */
  --celeste-claro: #e3eff6;
  --tinta: #1d1d1f;       /* wordmark */
  --tinta-2: #4a5056;
  --gris: #6b7279;
  --linea: #dcdad4;
  --fondo: #f6f5f2;
  --papel: #ffffff;
  --ok: #1f6b45;
  --ok-claro: #e2f1e8;
  --aviso: #8a5a00;
  --aviso-claro: #fbf0d6;
  --error: #b3261e;
  --error-claro: #fbe7e5;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(16, 24, 32, .06), 0 4px 14px rgba(16, 24, 32, .06);
  --f-texto: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-titulo: 'Barlow Semi Condensed', 'Barlow', 'Arial Narrow', system-ui, sans-serif;
  --toque: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-texto);
  font-size: 17px;
  line-height: 1.45;
  color: var(--tinta);
  background: var(--fondo);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--f-titulo); line-height: 1.15; margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: var(--azul); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--gris); }
.small { font-size: .9rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid var(--celeste); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--tinta); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- Barra superior ---------- */
.topbar { background: var(--papel); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 var(--linea); padding-top: env(safe-area-inset-top); }
.topbar__in { max-width: 920px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); min-height: var(--toque); }
.brand__logo { height: 48px; width: auto; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--f-titulo); font-weight: 700; font-size: 1.3rem; }
.brand__legal { font-size: .78rem; color: var(--azul-osc); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.roadline { height: 4px; background: var(--azul-osc);
  background-image: repeating-linear-gradient(90deg, var(--celeste) 0 26px, transparent 26px 44px);
  background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 1px; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--toque); min-width: var(--toque); justify-content: center;
  padding: 0 12px; border-radius: 12px; color: var(--tinta); text-decoration: none; font-weight: 600; border: 1px solid transparent; background: none; cursor: pointer; font: inherit; }
.iconbtn:hover { background: var(--fondo); }
.iconbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { .iconbtn__label { display: none; } .brand__legal { font-size: .7rem; } }

main { max-width: 920px; margin: 0 auto; padding: 20px 16px 210px; outline: none; }
.loading { padding: 40px; text-align: center; color: var(--gris); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--toque); padding: 10px 18px;
  border-radius: 12px; border: 2px solid transparent; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  line-height: 1.2; text-align: center; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--pri { background: var(--azul); color: #fff; }
.btn--pri:hover { background: var(--azul-osc); }
.btn--sec { background: var(--papel); color: var(--azul-osc); border-color: var(--azul); }
.btn--sec:hover { background: var(--celeste-claro); }
.btn--ghost { background: transparent; color: var(--tinta-2); border-color: var(--linea); }
.btn--ghost:hover { background: var(--papel); }
.btn--peligro { background: var(--papel); color: var(--error); border-color: #e7b7b3; }
.btn--peligro:hover { background: var(--error-claro); }
.btn--ok { background: var(--ok); color: #fff; }
.btn--grande { min-height: 60px; font-size: 1.15rem; padding: 14px 22px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 auto; }

/* ---------- Tarjetas ---------- */
.card { background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px; margin-bottom: 16px; border: 1px solid #ebe9e4; }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__title h2 { margin: 0; }

/* ---------- Inicio ---------- */
.hero { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }
.hero h1 { margin-bottom: 4px; }
.hero p { color: var(--tinta-2); margin: 0; }
.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 6px 0 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--linea);
  background: var(--papel); font: inherit; font-weight: 600; font-size: .95rem; color: var(--tinta-2); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.chip .cuenta { font-variant-numeric: tabular-nums; opacity: .75; }

.lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; background: var(--papel); border: 1px solid #ebe9e4;
  border-radius: var(--radio); padding: 14px; text-decoration: none; color: inherit; box-shadow: var(--sombra); min-height: 84px; }
.item:hover { border-color: var(--celeste); }
.item__ico { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--celeste-claro); color: var(--azul-osc); }
.item__ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.item__main { min-width: 0; }
.item__nombre { font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__meta { color: var(--gris); font-size: .92rem; }
.item__der { text-align: right; }
.item__total { font-family: var(--f-titulo); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }

.estado { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.estado--borrador { background: var(--aviso-claro); color: var(--aviso); }
.estado--enviada { background: var(--ok-claro); color: var(--ok); }
.estado--ejemplo { background: var(--error-claro); color: var(--error); }

.vacio { text-align: center; padding: 26px 18px; }
.vacio__logo { width: 140px; margin: 0 auto 10px; }
.pasos { list-style: none; counter-reset: p; padding: 0; margin: 18px 0; text-align: left; display: grid; gap: 10px; }
.pasos li { counter-increment: p; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; }
.pasos li::before { content: counter(p); width: 30px; height: 30px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-family: var(--f-titulo); }

/* ---------- Tipo de rendición ---------- */
.tipos { display: grid; gap: 12px; }
@media (min-width: 720px) { .tipos { grid-template-columns: repeat(3, 1fr); } }
.tipo { display: grid; grid-template-columns: 60px 1fr; gap: 14px; align-items: center; text-align: left; background: var(--papel); border: 2px solid #e6e3dd;
  border-radius: 16px; padding: 18px; cursor: pointer; font: inherit; color: inherit; min-height: 96px; box-shadow: var(--sombra); }
.tipo:hover, .tipo:focus-visible { border-color: var(--azul); }
@media (min-width: 720px) { .tipo { grid-template-columns: 1fr; align-content: start; } }
.tipo__ico { width: 60px; height: 60px; border-radius: 14px; background: var(--azul); color: #fff; display: grid; place-items: center; }
.tipo__ico svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tipo strong { display: block; font-family: var(--f-titulo); font-size: 1.3rem; }
.tipo span.d { color: var(--gris); font-size: .95rem; }

/* ---------- Formularios ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } .full { grid-column: 1 / -1; } }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label, .campo .label { font-weight: 600; font-size: .98rem; }
.campo .req { color: var(--error); font-weight: 700; }
.campo .ayuda { color: var(--gris); font-size: .88rem; }
.campo .err { color: var(--error); font-size: .9rem; font-weight: 600; }
.campo .warn { color: var(--aviso); font-size: .9rem; }
input[type=text], input[type=email], input[type=date], input[type=search], input[type=tel], select, textarea {
  font: inherit; font-size: 1.05rem; color: var(--tinta); width: 100%; min-height: var(--toque); padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid #c9c6bf; background: #fff; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); outline: 3px solid rgba(72, 144, 182, .35); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--error) !important; background: #fffafa; }
.monto-input { font-family: var(--f-titulo); font-size: 1.6rem !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.monto-wrap { position: relative; }
.monto-wrap::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--f-titulo); font-size: 1.6rem; font-weight: 700; color: var(--gris); }
.monto-wrap input { padding-left: 34px; }

.seccion-label { font-family: var(--f-titulo); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--azul-osc); font-size: .95rem; margin: 0 0 10px; }
.tipo-actual { display: flex; align-items: center; gap: 12px; }
.tipo-actual .tipo__ico { width: 46px; height: 46px; }
.tipo-actual .tipo__ico svg { width: 26px; height: 26px; }
.guardado { font-size: .88rem; color: var(--gris); min-height: 1.3em; }

.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-weight: 500; }
.banner--ejemplo { background: var(--error-claro); color: var(--error); border: 1px dashed #e0a39e; }
.banner--info { background: var(--celeste-claro); color: var(--azul-osc); }
.banner--ok { background: var(--ok-claro); color: var(--ok); }
.banner--error { background: var(--error-claro); color: var(--error); }
.banner ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Boletas ---------- */
.boletas { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.boleta { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--linea); border-radius: 12px; background: #fff; }
.boleta__foto { width: 72px; height: 88px; border-radius: 8px; object-fit: cover; background: var(--fondo); border: 1px solid var(--linea); cursor: zoom-in; padding: 0; }
.boleta__foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.boleta__top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.boleta__prov { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.boleta__monto { font-family: var(--f-titulo); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.boleta__meta { color: var(--gris); font-size: .9rem; }
.cat { display: inline-block; background: var(--celeste-claro); color: var(--azul-osc); font-weight: 600; font-size: .82rem; padding: 2px 8px; border-radius: 6px; }
.boleta__acc { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.boleta__acc .btn { min-height: 42px; padding: 6px 12px; font-size: .95rem; }
.sin-boletas { border: 2px dashed var(--linea); border-radius: 12px; padding: 22px; text-align: center; color: var(--gris); margin-bottom: 14px; }

/* ---------- Barra de total (fija abajo) ---------- */
.totalbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--tinta); color: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(0, 0, 0, .18); }
.totalbar__in { max-width: 920px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 10px; }
.totalbar__monto { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.totalbar__label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: #c4d9e6; font-weight: 600; }
.totalbar__valor { font-family: var(--f-titulo); font-weight: 700; font-size: 2.1rem; line-height: 1; font-variant-numeric: tabular-nums; }
.totalbar .btn-row .btn { flex: 1 1 0; }
.totalbar .btn--ghost { color: #fff; border-color: #5b6168; }
.totalbar .btn--ghost:hover { background: #2c2f33; }
@media (min-width: 720px) { .totalbar__in { grid-template-columns: 1fr auto; align-items: center; } .totalbar .btn-row { min-width: 420px; } }

/* ---------- Diálogos ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--tinta); }
dialog::backdrop { background: rgba(15, 25, 35, .55); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 20px); }
.dlg__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--linea); }
.dlg__head h2 { margin: 0; }
.dlg__body { padding: 16px; overflow-y: auto; }
.dlg__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); display: flex; gap: 10px; flex-wrap: wrap; }
.dlg__foot .btn { flex: 1 1 0; }
@media (max-width: 600px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 94dvh; }
  dialog.sheet .dlg { max-height: 94dvh; }
}

.foto-zona { border: 2px dashed #bcc9d2; border-radius: 14px; padding: 14px; text-align: center; background: #fafcfd; }
.foto-zona.tiene { border-style: solid; border-color: var(--linea); background: #fff; }
.foto-zona img { max-height: 260px; margin: 0 auto 10px; border-radius: 8px; object-fit: contain; }
.foto-zona .btn-row { justify-content: center; }
.foto-zona input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.foto-zona.foto-zona--err { border-color: var(--error); }

.visor img { max-height: 78dvh; width: auto; margin: 0 auto; }

/* ---------- Expediente / resumen ---------- */
.exp-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 3px solid var(--azul-osc); margin-bottom: 14px; }
.exp-head img { width: 76px; }
.exp-head .num-rend { color: var(--gris); font-size: .9rem; }
.exp-total { background: var(--azul-osc); color: #fff; border-radius: 14px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.exp-total .v { font-family: var(--f-titulo); font-size: 2.4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.exp-total .l { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #c4d9e6; font-weight: 600; }
.datos { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.datos > div { display: grid; grid-template-columns: 42% 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eeece7; }
.datos dt { color: var(--gris); }
.datos dd { margin: 0; font-weight: 600; word-break: break-word; }
.tabla-wrap { overflow-x: auto; margin: 0 -4px; }
table.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla .nw { white-space: nowrap; }
.cat-movil { display: none; }
@media (max-width: 560px) { .tabla .col-cat { display: none; } .cat-movil { display: inline; } table.tabla { font-size: .9rem; } .tabla td, .tabla th { padding: 7px 5px; } }
.tabla th { text-align: left; background: var(--tinta); color: #fff; font-weight: 600; padding: 8px; font-size: .85rem; }
.tabla td { padding: 8px; border-bottom: 1px solid #eeece7; vertical-align: top; }
.tabla tr:nth-child(even) td { background: #faf9f6; }
.tabla .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla tfoot td { font-weight: 700; background: var(--celeste-claro); font-size: 1.05rem; border: 0; }
.cats { display: grid; gap: 6px; }
.cats div { display: flex; justify-content: space-between; gap: 10px; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.fotos figure { margin: 0; background: #fff; border: 1px solid var(--linea); border-radius: 10px; overflow: hidden; }
.fotos button { padding: 0; border: 0; background: none; width: 100%; cursor: zoom-in; display: block; }
.fotos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.fotos figcaption { padding: 6px 8px; font-size: .85rem; }

.envio { border: 2px solid var(--azul); }
.envio ol { list-style: none; padding: 0; margin: 0; counter-reset: e; display: grid; gap: 18px; }
.envio ol > li { counter-increment: e; display: grid; grid-template-columns: 38px 1fr; gap: 12px; }
.envio ol > li::before { content: counter(e); width: 34px; height: 34px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--f-titulo); font-size: 1.1rem; }
.envio h3 { margin: 4px 0 8px; }
.nota-correo { font-size: .92rem; color: var(--tinta-2); background: var(--fondo); border-left: 4px solid var(--celeste); padding: 8px 10px; border-radius: 0 8px 8px 0; margin: 10px 0 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%) translateY(20px); background: var(--tinta); color: #fff; padding: 12px 18px;
  border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.ver { opacity: 1; transform: translateX(-50%) translateY(0); }

.volver { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 600; text-decoration: none; min-height: 40px; }
.pie { text-align: center; color: var(--gris); font-size: .85rem; margin-top: 26px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .topbar, .totalbar, .no-print, .toast { display: none !important; } main { padding: 0; } .card { box-shadow: none; } }
