/* Módulo Bancos: cuentas, revisar movimientos, reglas y conciliación. Clases propias del módulo (esta hoja se carga en todas las páginas). */

/* Tarjetas de cuentas */
.bancos-tarjetas{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px;margin-bottom:14px}
.bancos-tarjetas .card+.card{margin-top:0}
.banco-tarjeta{display:flex;flex-direction:column;gap:12px}
.banco-tarjeta h2{margin:0;align-items:center}
.banco-tarjeta .botones{margin-top:auto;justify-content:flex-start}
.banco-cifras{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin:0}
.banco-cifras dt{font-size:12px;color:var(--suave)}
.banco-cifras dd{margin:2px 0 0;font-weight:600;text-align:left}

/* Revisar: barra de lote y movimientos */
.lote-barra{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px}
.lote-barra .opcion-linea{margin:0}
.mas-reglas{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:10px 0 14px}
.card.mov{padding:0}
.card.mov+.card.mov{margin-top:8px}
.mov>summary{display:flex;align-items:center;gap:12px;padding:12px 16px;cursor:pointer;list-style:none}
.mov>summary::-webkit-details-marker{display:none}
.mov>summary input[type=checkbox]{width:20px;height:20px;flex:none;margin:0}
.mov-fecha{flex:none;width:96px;color:var(--suave);font-size:13px;white-space:nowrap}
.mov-desc{flex:1 1 200px;min-width:0;overflow-wrap:anywhere}
.mov-desc small{display:block;font-size:12px}
.mov-sug{flex:0 1 auto;min-width:0}
.mov-sug .chip{white-space:normal}
.mov-monto{flex:none;min-width:96px;text-align:right;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.mov[open]>summary{border-bottom:1px solid var(--borde)}
.mov-cuerpo{padding:14px 16px;display:grid;gap:16px}
.mov-cuerpo h3{font-size:14px;margin:0 0 8px}
.mov-form .opcion+.opcion{margin-top:8px}
.mov-form .botones{margin-top:10px}
.form.mov-form .botones{margin-top:0}
.mov-excluir{display:flex;justify-content:flex-end}

/* Reglas */
.acciones-fila{text-align:right}
.acciones-fila form{display:inline-flex;gap:4px}
.acciones-fila .btn.chico{vertical-align:middle}

/* Conciliar */
.conc-cabeza{margin-bottom:14px}
.conc-cifras{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:0}
.conc-cifras>div{background:var(--fondo);border-radius:var(--radio);padding:8px 12px}
.conc-cifras dt{font-size:12px;color:var(--suave)}
.conc-cifras dd{margin:2px 0 0;font-weight:600;font-size:16px;text-align:left}
.conc-dif{border:2px solid var(--borde)}
.conc-dif dd{font-size:20px;font-weight:700}
.conc-tabla td:first-child,.conc-tabla th:first-child{width:40px}
.conc-tabla input[type=checkbox]{width:20px;height:20px;margin:0}
.conc-archivo{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.conc-archivo a{display:inline-flex;align-items:center;gap:4px;overflow-wrap:anywhere}
.conc-leer>summary{cursor:pointer;display:inline-flex;align-items:center;gap:6px;color:var(--acento);font-weight:500}
.conc-leer-cuerpo{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:10px}
.conc-leer-cuerpo small{flex-basis:100%}
.conc-lista>summary h2{justify-content:flex-start;align-items:center;margin:0}
.conc-lista>summary h2::after{content:"";margin-left:auto;width:8px;height:8px;border-right:2px solid var(--suave);border-bottom:2px solid var(--suave);transform:rotate(45deg);transition:transform .15s}
.conc-lista[open]>summary h2::after{transform:rotate(-135deg)}
.banco-origen{margin:0 0 14px}
.conc-hist-acc{display:inline-flex;gap:4px;vertical-align:middle;margin-left:6px}
.conc-hist-acc form{display:inline-flex}
.plaid-item h2{align-items:center}
.plaid-cuentas select{width:100%;min-width:160px}

/* Informe de conciliación */
.reporte-conc .conc-resumen{max-width:560px;margin-top:12px}
.reporte-conc .conc-resumen td{border-bottom:1px solid var(--borde)}

@media(max-width:600px){
  .bancos-tarjetas{grid-template-columns:1fr}
  .banco-tarjeta .botones .btn,.lote-barra .btn,.mas-reglas .btn,.mov-cuerpo .btn,.conc-cabeza .botones .btn,.acciones-fila .btn{min-height:44px;justify-content:center}
  .banco-tarjeta .botones .btn{flex:1 1 auto}
  .lote-barra .botones{width:100%}.lote-barra .botones .btn{flex:1 1 0}
  .mov>summary{flex-wrap:wrap;gap:6px 10px;padding:12px}
  .mov>summary input[type=checkbox]{width:24px;height:24px}
  .mov-fecha{width:auto;order:1}
  .mov>summary input[type=checkbox]{order:0}
  .mov-monto{order:2;margin-left:auto;min-width:0}
  .mov-desc{order:3;flex:1 1 100%}
  .mov-sug{order:4;flex:1 1 auto}
  .mov>summary .btn.chico{order:5;min-height:44px;min-width:88px;justify-content:center;font-size:14px}
  .mov-cuerpo{padding:12px}
  .form.mov-form{grid-template-columns:1fr}
  .mov-cuerpo select,.mov-cuerpo input:not([type=radio]):not([type=checkbox]),.conc-cabeza input{min-height:44px;font-size:16px;width:100%}
  .mov-form .botones .btn{flex:1 1 0}
  .mov-excluir .btn{width:100%}
  .conc-cabeza .botones .btn{flex:1 1 0}
  .conc-cifras{grid-template-columns:1fr 1fr}
  .conc-dif{grid-column:1/-1}
  .conc-tabla input[type=checkbox]{width:26px;height:26px}
  .conc-leer-cuerpo input[type=file],.conc-leer-cuerpo .btn{width:100%;min-height:44px;justify-content:center}
  .plaid-item .botones .btn{flex:1 1 auto;min-height:44px;justify-content:center}
  .conc-tabla td{padding:10px 8px}
  .acciones-fila .btn.chico{min-width:44px}
}
@media print{.mov-cuerpo,.lote-barra,.mas-reglas{display:none!important}.conc-cifras>div{background:none;border:1px solid var(--borde)}}

/* Celular: «Handled» y las reglas se apilan en tarjetitas para que el monto y los botones no queden fuera de la pantalla. */
@media (max-width: 600px) {
  .banco-hechos thead, .tabla.reglas thead { display: none; }
  .banco-hechos, .banco-hechos tbody, .tabla.reglas, .tabla.reglas tbody { display: block; }
  .banco-hechos tr, .tabla.reglas tr { display: grid; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--borde); }
  .banco-hechos td, .tabla.reglas td { display: block; padding: 0; border: 0; }
  .banco-hechos tr { grid-template-columns: 1fr auto; }
  .banco-hechos td:nth-child(1) { grid-area: 1 / 1; color: var(--suave); }
  .banco-hechos td:nth-child(5) { grid-area: 1 / 2; font-weight: 600; }
  .banco-hechos td:nth-child(2) { grid-column: 1 / -1; font-weight: 600; }
  .banco-hechos td:nth-child(4) { grid-column: 1 / -1; }
  .banco-hechos td:nth-child(6) { grid-column: 1 / -1; justify-self: end; }
  .banco-hechos td:nth-child(6) .btn { min-height: 44px; min-width: 44px; justify-content: center; }
  .tabla.reglas tr { grid-template-columns: auto 1fr; }
  .tabla.reglas td:nth-child(1) { grid-row: 1 / 3; }
  .tabla.reglas td:nth-child(6) { grid-column: 1 / -1; justify-self: end; }
  .banco-hechos .ocultar-cel, .tabla.reglas .ocultar-cel { display: none; }
  /* Movimientos de una cuenta: fecha y monto arriba, descripción, estado y deshacer abajo. */
  .banco-movs thead { display: none; }
  .banco-movs, .banco-movs tbody { display: block; }
  .banco-movs tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--borde); }
  .banco-movs td { display: block; padding: 0; border: 0; }
  .banco-movs td:nth-child(1) { grid-area: 1 / 1; color: var(--suave); }
  .banco-movs td:nth-child(4) { grid-area: 1 / 2; font-weight: 600; }
  .banco-movs td:nth-child(2) { grid-column: 1 / -1; font-weight: 600; }
  .banco-movs td:nth-child(3) { grid-column: 1 / 2; align-self: center; }
  .banco-movs td:nth-child(5) { grid-column: 2 / 3; justify-self: end; }
  .banco-movs td:nth-child(5) .btn { min-height: 44px; min-width: 44px; justify-content: center; }
}
