/* Facturación: lo propio del módulo (lo común está en /shared/base.css). */
.badge-emitida { background: var(--accent-soft); color: var(--accent-strong); }
.badge-recibida { background: var(--info-soft); color: var(--info); }
.badge-hoja { background: var(--warn-soft); color: var(--warn); }
.badge-ticket { background: var(--paper); border: 1px solid var(--line-strong); color: var(--ink); }
.badge-subv { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
/* ---------- líneas de factura y viajes ---------- */
.lines { display: grid; gap: 8px; grid-column: 1 / -1; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px 110px 36px; gap: 8px; align-items: center; }
.line-head { font-size: 12px; font-weight: 700; color: var(--muted); }
.line .importe { font-weight: 600; }
@media (max-width: 720px) {
  .line { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
  .line > :first-child { grid-column: 1 / -1; }
  .line-head { display: none; }
}
.trips { display: grid; gap: 10px; grid-column: 1 / -1; }
.trip { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) 90px auto; align-items: end; background: var(--surface); }
.trip .motivo { grid-column: 1 / 4; }
.trip .costs { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.trip .trip-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; padding-bottom: 8px; white-space: nowrap; }
@media (max-width: 820px) {
  .trip, .trip .costs { grid-template-columns: 1fr 1fr; }
  .trip .motivo { grid-column: 1 / -1; }
}
/* La hoja que pide un socio (/facturacion/hoja/): desplazamientos, botón, tarifas y total. */
.viajes-socio { display: grid; gap: 10px; }
.viajes-socio .totals { margin-top: 4px; }
.hoja-app { display: grid; gap: 24px; }
/* Tarjeta de una hoja pedida: quién y estado a la izquierda, el total siempre a la derecha (también
   en el móvil) y los datos en dos columnas, que no ocupe una pantalla entera. */
.hoja-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hoja-card-quien { min-width: 0; }
.hoja-card-quien h3 { overflow-wrap: anywhere; }
.hoja-card .badges { margin-top: 6px; }
.hoja-card .socio-card-grid { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); padding-top: 10px; border-top: 1px solid var(--line); }
.hoja-total { flex: none; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; text-align: right; white-space: nowrap; }
.hoja-total small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.plain-list { margin: 0; padding-left: 18px; }
.totals { grid-column: 1 / -1; justify-self: end; min-width: min(100%, 360px); display: grid; gap: 4px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 18px; }
.totals .grand { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.subv-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.subv-checks .check { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.subv-checks .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
/* ---------- subvenciones ---------- */
.subv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.subv-card { padding: 16px; display: grid; gap: 10px; }
.subv-card h3 { font-size: 16px; }
.meter { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.over > i { background: var(--warn); }
.subv-grupo { border-color: var(--accent); }
.subv-lista { display: grid; gap: 4px; font-size: 13px; list-style: none; padding: 8px 0 0; border-top: 1px dashed var(--line); }
.subv-lista li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.subv-rows { display: grid; gap: 3px; font-size: 13.5px; }
.subv-rows div { display: flex; justify-content: space-between; gap: 10px; }
.subv-edit { display: grid; gap: 10px; grid-column: 1 / -1; }
.subv-edit-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) 90px 120px auto auto; gap: 8px; align-items: center; }
@media (max-width: 1100px) {
  .subv-edit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px 120px auto auto; }
  .subv-edit-row > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .subv-edit-row { grid-template-columns: 1fr 1fr; }
  .subv-edit-row > :first-child { grid-column: 1 / -1; }
}
/* agenda de clientes (ajustes) */
.clientes-card { margin-top: 18px; }
.cliente-rows { display: grid; margin-top: 10px; }
.cliente-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.cliente-datos { display: grid; gap: 2px; min-width: 0; }
.cliente-datos span { overflow: hidden; text-overflow: ellipsis; }
.req-actions { align-items: center; }
table.data td.c-doc { min-width: 260px; }
table.data td.c-acc .row-actions { flex-wrap: nowrap; }
@media (max-width: 720px) {
  table.data thead { display: none; }
  table.data tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px;
    grid-template-areas: "fecha imp" "doc doc" "subv subv" "estado estado" "acc acc";
    border-bottom: 1px solid var(--line);
  }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data td { border: 0; padding: 0; min-width: 0; }
  table.data td.c-doc { min-width: 0; grid-area: doc; }
  table.data td.c-fecha { grid-area: fecha; color: var(--muted); font-size: 13px; }
  table.data td.c-imp { grid-area: imp; font-weight: 700; }
  table.data td.c-subv { grid-area: subv; }
  table.data td.c-subv:has(.muted) { display: none; }
  table.data td.c-estado { grid-area: estado; align-self: center; }
  table.data td.c-acc { grid-area: acc; width: auto; }
  table.data td.c-acc .row-actions { flex-wrap: wrap; justify-content: flex-start; margin-left: -8px; }
}
/* Estado de cobro/pago que se cambia con un clic (Documentos). */
.badge-pago { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; }
.badge-pago .casilla { display: inline-grid; place-items: center; width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; }
.badge-pago:hover, .badge-pago:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 1px; }
.badge-pago.ocupado { opacity: .6; cursor: progress; }
.badge-clip { display: inline-flex; margin-left: 6px; border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; background: var(--info-soft); color: var(--info); }
.badge-clip:hover { text-decoration: underline; }
.comp-list { list-style: none; margin: 10px 0 16px; padding: 0; display: grid; gap: 6px; }
.comp-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); min-width: 0; }
.comp-list li.muted { justify-content: center; border-style: dashed; }
.comp-list .comp-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--ink); text-decoration: underline; overflow-wrap: anywhere; }
.comp-list .btn.confirm { width: auto; }
@media (max-width: 720px) {
  table.data td.c-estado { display: flex; flex-wrap: wrap; gap: 4px; }
  .badge-clip { margin-left: 0; }
}
/* ---------- página de campaña ---------- */
.public-intro .pill { display: inline-block; margin-bottom: 8px; }
.campana-texto { white-space: pre-line; }
.campana-opciones { display: grid; gap: 8px; }
.campana-opcion { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }
.campana-opcion span { flex: 1; }
.campana-opcion:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.campana-total { margin-right: auto; align-self: center; font-size: 17px; }
.campana-edit-ops { display: grid; gap: 6px; grid-column: 1 / -1; }
.campana-edit-op { display: grid; grid-template-columns: 1fr 120px auto; gap: 6px; }
.campana-link { overflow-wrap: anywhere; }
.badge-mail { display: inline-flex; gap: 3px; align-items: center; margin-left: 6px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent-strong); }
.envio-check { font-weight: 600; }
@media (max-width: 720px) {
  .badge-mail { margin-left: 0; }
}
.just-list { display: flex; flex-wrap: wrap; gap: 4px; }
.just-list .badge-clip { margin-left: 0; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
#justificantes .dz-files { margin-top: 6px; }

/* Subir lo que ha preparado Claude (/facturacion/subir/) */
.subir-wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 0; }
.subir-head { margin-bottom: 16px; }
.subir-head h1 { font-size: clamp(22px, 4vw, 28px); margin: 0 0 4px; }
.subir-head p { margin: 0; }
.subir-head .subir-notas { margin-top: 6px; }
.subir-filas { display: grid; gap: 10px; margin-bottom: 14px; }
.subir-fila { display: grid; gap: 10px; padding: 14px 16px; }
.subir-cab { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.subir-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 13px; }
.subir-tit { display: grid; gap: 1px; min-width: 0; }
.subir-tit h2 { font-size: 15.5px; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.subir-importe { font-weight: 700; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.subir-cuerpo { display: grid; gap: 6px; padding-left: 38px; }
.subir-concepto { margin: 0; }
.subir-cuerpo .badges { margin: 0; }
.subir-notas { margin: 0; }
.subir-zonas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-left: 38px; }
.subir-zonas .dropzone-sm { padding: 10px; }
.subir-zonas .dz-text { font-size: 13px; gap: 2px 8px; }
.subir-zonas .dz-text small { flex-basis: 100%; }
.subir-estado { margin: 0; padding-left: 38px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.subir-estado:empty { display: none; }
.subir-estado.subir-error { color: var(--red); }
.subir-fila-hecha { background: var(--paper); box-shadow: none; }
.subir-fila-hecha .subir-estado { color: var(--accent-strong); }
.subir-barra { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 0 16px; background: linear-gradient(transparent, var(--paper) 30%); }
@media (max-width: 560px) {
  .subir-zonas { grid-template-columns: 1fr; padding-left: 0; }
  .subir-cuerpo, .subir-estado { padding-left: 0; }
  .subir-barra .btn { flex: 1; }
}
