/* REDLINE · estilos comunes a todas las pantallas (2026-11-02)
   1) Listados largos: la tabla hace scroll dentro de su caja y la CABECERA SE QUEDA FIJA arriba (petición del usuario: «el scroll en listados
      largos siempre debe arrastrar la cabecera de la tabla, en todas las pantallas»). Vale para las tablas de Redline y para las heredadas
      (.data-table dentro de una tarjeta con scroll, como la de Usuarios).
   2) Enlace a la ficha de cliente (redline_ficha.js): cualquier nombre de cliente pinchable. */
.rl-scroll, .rlg-tw, .rld-tw, .rlc-tw, .rlp-tw { max-height: 70vh; overflow: auto; }
.rl-scroll thead th, .rlg-tw thead th, .rld-tw thead th, .rlc-tw thead th, .rlp-tw thead th, .rlg-mapa thead th {
    position: sticky; top: 0; z-index: 3; background: #fff; box-shadow: inset 0 -1px 0 #e2e8f0; }
.rlg-mapa thead th:first-child { left: 0; z-index: 4; }
.glass-card[style*="overflow:auto"] { max-height: 75vh; }
.glass-card .data-table thead th { position: sticky; top: 0; z-index: 3; background: var(--bg-card, #fff); box-shadow: inset 0 -1px 0 #e2e8f0; }

.rl-cli { color: inherit; font-weight: 700; text-decoration: none; border-bottom: 1px dashed #94a3b8; cursor: pointer; }
.rl-cli:hover { color: var(--accent-red, #be0b1e); border-bottom-color: var(--accent-red, #be0b1e); }
.rl-cli::after { content: '\f35d'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .62em; margin-left: 4px; opacity: .45; }

/* 3) style.css (heredado de Wolco) pone «white-space: nowrap» a TODAS las celdas: un concepto largo ensanchaba la tabla hasta sacar
      columnas y la barra de scroll fuera de la vista. En las tablas de Redline el texto se parte; importes y fechas (.n) no. */
.rlg-t td, .rld-hist td, .rlc-t td, .rlp-t td, .rlf-t td { white-space: normal; overflow-wrap: break-word; }
.rlg-t td.n, .rld-hist td.n, .rlc-t td.n, .rlp-t td.n, .rlf-t td.n { white-space: nowrap; overflow-wrap: normal; }
.rlg-t th, .rld-hist th, .rlc-t th, .rlp-t th, .rlf-t th { white-space: nowrap; }
/* Barras de scroll visibles dentro de la caja del listado (y no al final de la página) */
.rl-scroll, .rlg-tw, .rld-tw, .rlc-tw, .rlp-tw, .glass-card[style*="overflow:auto"] { scrollbar-width: thin; scrollbar-color: #94a3b8 #f1f5f9; }
.rl-scroll::-webkit-scrollbar, .rlg-tw::-webkit-scrollbar, .rld-tw::-webkit-scrollbar, .rlc-tw::-webkit-scrollbar, .rlp-tw::-webkit-scrollbar { width: 10px; height: 10px; }
.rl-scroll::-webkit-scrollbar-thumb, .rlg-tw::-webkit-scrollbar-thumb, .rld-tw::-webkit-scrollbar-thumb, .rlc-tw::-webkit-scrollbar-thumb, .rlp-tw::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 99px; }
.rl-scroll::-webkit-scrollbar-track, .rlg-tw::-webkit-scrollbar-track, .rld-tw::-webkit-scrollbar-track, .rlc-tw::-webkit-scrollbar-track, .rlp-tw::-webkit-scrollbar-track { background: #f1f5f9; }
.rlg-tw, .rld-tw, .rlc-tw, .rlp-tw { border: 1px solid #eef2f7; border-radius: 10px; }
/* En móvil style.css convierte cada tabla en un bloque con scroll propio: en las de Redline el scroll lo lleva su caja (cabecera fija) */
@media (max-width: 980px) {
    .view-panel .rl-scroll table, .view-panel .rlg-tw table, .view-panel .rld-tw table, .view-panel .rlc-tw table, .view-panel .rlp-tw table, .rlf-modal table,
    .view-panel table.rlg-mapa { display: table; overflow: visible; white-space: normal; }
    .rlg-t td, .rlc-t td, .rlp-t td, .rlf-t td { min-width: 70px; }
}

/* 4) Usuarios › Permisos por rol (heredado): el desplegable «¿Quién tiene acceso a…?» tomaba el ancho de su opción más larga y la fila se
      salía por la derecha; ahora ocupa el espacio que hay. */
.roles-tools-row { max-width: 100%; box-sizing: border-box; }
.roles-tools-row select, .roles-tools-row input { flex: 1 1 220px; width: auto; min-width: 0; max-width: 100%; }

/* 5) CRM: las pestañas de GASCA que no arrancan en Redline (Mi cartera de BEKOSU, licitaciones) llevan «hidden», pero .crm-tab tiene display:flex */
.crm-tab[hidden] { display: none !important; }

/* «Entrar con Google» en la pantalla de acceso (api/redline_google.py) */
.login-google { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding: 11px 14px; border: 1px solid #dadce0; border-radius: 10px; background: #fff; color: #3c4043; font-weight: 600; font-size: .92rem; text-decoration: none; }
.login-google:hover { background: #f8fafc; border-color: #c7cbd1; }
.login-google[hidden] { display: none; }
