/* --- Reset básico --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Fuentes y fondo global --- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #e5ecf3;
  color: #333333;
  line-height: 1.6;
  padding-bottom: 60px; /* espacio para el footer */
}

/* --- Encabezado --- */
header {
  background-color: #3c5f7f;
  color: white;
  padding: 1em;
  text-align: center;
}

header h1 {
  font-size: 1.8em;
}

/* --- Contenedor principal --- */
main {
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}



/* --- Formularios --- */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: bold;
  margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  padding: 10px;
  border: 1px solid #cccccc;
  border-radius: 5px;
  font-size: 1em;
}

button {
  padding: 10px;
  background-color: #507ea4;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #3c5f7f;
}

/* --- Tablas --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th, td {
  border: 1px solid #cccccc;
  padding: 10px;
  text-align: left;
}

th {
  background-color: #f2f6fa;
}

/* --- Footer --- */
footer {
  background-color: #3c5f7f;
  color: white;
  text-align: center;
  padding: 2px;
  position: fixed;
  bottom: 0;
  width: 100%;
}

/* Caja visual del login */
.login-box {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px 25px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.login-box h2 {
  margin-bottom: 20px;
  color: #3c5f7f;
}
.login-box {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px 25px;
  background-color: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.login-box h2 {
  margin-bottom: 20px;
  color: #3c5f7f;
}
  
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px; /* espacio para el ojito */
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background-color: transparent;
  border: none;
  font-size: 1.1em;
  cursor: pointer;
  color: #507ea4;
  padding: 0;
  line-height: 1;
}

.menu-container {
  text-align: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.menu-card {
  display: block;
  padding: 30px 20px;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 12px;
  text-decoration: none;
  color: #333;
  font-size: 1.1em;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.menu-card:hover {
  background-color: #dbe6f0; /* azul grisáceo al pasar el cursor */
  transform: translateY(-3px);
}

.reporte-container {
  max-width: 1200px;
  margin: 0 auto;
}

.cliente-info {
  background-color: #f4f9fd;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.tablas-reporte {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  justify-content: center;   /* centra las tarjetas cuando sólo hay 1 columna */
}

@media (min-width: 900px) {
  .tablas-reporte {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;       /* ancho máximo del bloque de 3 tablas */
    margin: 0 auto;          /* centra el bloque dentro del main */
  }
}

.tabla {
  padding: 15px;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tabla h3 {
  text-align: center;
  margin-bottom: 15px;
}

.tabla table {
  width: 100%;
  border-collapse: collapse;
}

.tabla table th,
.tabla table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: center;
  font-size: 0.95em;
}

.tabla-azul {
  background-color: #e5f0fb;
}

.tabla-verde {
  background-color: #e0f6e9;
}

.tabla-naranja {
  background-color: #fff4e5;
}

.alertas {
  margin-top: 40px;
  text-align: center;
}

.alerta-atraso {
  color: #c0392b;
  font-weight: bold;
  margin-bottom: 15px;
}

.boton-recibo {
  padding: 10px 25px;
  background-color: #507ea4;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
}

.botones-reporte {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.boton-formular-pago,
.boton-recibo {
  padding: 10px 25px;
  background-color: #507ea4;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
}

.boton-formular-pago:hover,
.boton-recibo:hover {
  background-color: #3c5f7f;
}

.boton-recibo-pdf {
  display: inline-block;
  text-align: center;
  margin-top: 15px;
  width: 100%;
  padding: 12px;
  background-color: #4caf50;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1.05em;
  transition: background-color 0.3s;
}

.boton-recibo-pdf:hover {
  background-color: #3e8e41;
}

.tabla-scroll {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.tabla-scroll table {
  border-collapse: collapse;
  width: 100%;
}

.tabla-scroll thead th {
  position: sticky;
  top: 0;
  background-color: #2f4f6f;
  color: white;
  z-index: 2;
}

.container {
  max-width: 1000px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h2 {
  text-align: center;
  color: #2f4f6f;
  margin-bottom: 20px;
}

.info {
  margin-bottom: 25px;
  font-weight: bold;
  color: #333;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

th, td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #2f4f6f;
  color: white;
}

input[type="date"],
input[type="number"] {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 90%;
}

.btn-guardar {
  display: block;
  margin: 0 auto;
  padding: 10px 20px;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.btn-guardar:hover {
  background-color: #27ae60;
}

/* ===== Panel de gastos (reusa card-grid/menu-card) ===== */
.kpi-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 14px;
margin: 20px 0;
}

.kpi-card {
background: #f4f9fd;
border-radius: 12px;
padding: 14px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
text-align: center;
}

.kpi-card h3 { color: #507ea4; margin-bottom: 6px; }
.kpi-value { font-size: 1.3rem; font-weight: 700; }

/* Filtros compactos */
.filtros-bar {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
margin: 10px 0 16px;
align-items: end;
}

.filtros-actions {
display: flex;
gap: 10px;
}

/* Secciones por centro */
.centro-section { margin: 20px auto; max-width: 1000px; }
.centro-header {
display: flex;
justify-content: space-between;
align-items: center;
margin: 10px 0 12px;
}
.centro-header h2 { color: #2f4f6f; }

/* Botón agregar movimiento (reusa paleta) */
.btn-agregar-mov {
display: inline-block;
background-color: #507ea4;
color: #fff;
padding: 10px 16px;
border-radius: 6px;
text-decoration: none;
}
.btn-agregar-mov:hover { background-color: #3c5f7f; }

/* KPIs (reutilizados del patrón anterior) */

.kpi-card {
background: #f4f9fd;
border-radius: 12px;
padding: 14px;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
text-align: center;
}
.kpi-card h3 { color: #507ea4; margin-bottom: 6px; }
.kpi-value { font-size: 1.2rem; font-weight: 700; }

/* Títulos de tabla dentro de .tabla */
.tabla-titulo { text-align:center; margin: 6px 0 8px; color:#333; }


/* ===== Rediseño sutil de Menú ===== */
.menu-container h2 {
color: #2f4f6f;
text-align: center;
margin-top: 10px;
margin-bottom: 12px;
font-size: 1.6em;
letter-spacing: .2px;
}

.menu-card {
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
gap: 6px;
align-items: flex-start;
}

.menu-card .card-sub {
display: block;
font-size: .92em;
font-weight: normal;
color: #5a6f84;
opacity: .9;
}

/* Acento visual para el botón de gastos */
.menu-card--accent {
border: 2px solid #507ea4;
box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.menu-card--accent:hover {
background-color: #d1dfec; /* un toque más notorio que el hover normal */
}

/* Mejora de interacción */
.menu-card:focus {
outline: 3px solid #9fb9cf;
outline-offset: 2px;
}

/* ========== Vista Administrativa ========== */

.container {
max-width: 1200px;
margin: 30px auto;
padding: 20px;
}

.subtitulo {
color:#446b8d;
margin: 10px 0 20px;
font-weight: 600;
}

.bloque-fracc { margin-bottom: 56px; }
.bloque-fracc + .bloque-fracc { border-top: 1px solid #dbe6f1; padding-top: 36px; }

.dashboard {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 20px;
margin-bottom: 28px;
}

.card {
background-color: #f4f9fd;
border-radius: 12px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0,0,0,0.08);
text-align: center;
}
.card h3 { margin-bottom: 10px; color: #507ea4; }

.tabla-scroll { overflow:auto; border-radius: 8px; border: 1px solid #e3e3e3; }
.tabla-contratos { width: 100%; border-collapse: collapse; }
.tabla-contratos th, .tabla-contratos td {
padding: 12px; border: 1px solid #ccc; text-align: center;
}
.tabla-contratos th { background-color: #e2eaf3; }

.filtro { margin: 16px 0; }
.filtro input {
padding: 10px; width: 100%; border-radius: 6px; border: 1px solid #ccc;
}

/* Botones */
button, input[type="button"], input[type="submit"] {
appearance: none;
-webkit-appearance: none;
font: inherit;
}
.btn {
display: inline-block;
padding: 6px 12px;
border: 0;
border-radius: 6px;
text-decoration: none;
line-height: 1;
cursor: pointer;
color: #fff;
}
.btn-ver { background: #507ea4; }
.btn-ver:hover { background: #3c5f7f; }
.btn-eliminar { background: #c0392b; }
.btn-eliminar:hover { background: #a93226; }
.acciones .btn { margin: 0 5px; }

/* Alertas */
.alertas { margin: 32px 0 0; }
.alertas h2 { margin-bottom: 12px; }
.alert-item {
background-color: #fff4e5;
border-left: 5px solid #f0a500;
padding: 12px 15px;
margin-bottom: 10px;
border-radius: 6px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background-color: #f4f9fd;
  border-bottom: 1px solid #d1d5db;
}
.site-header .brand h1 {
  margin: 0;
  font-size: 1.3rem;
  color: #294861;
}
.site-header .user-info {
  font-weight: bold;
  color: #333;
}

.user-info{
  display: flex;
  align-items: center;
  gap: 10px;               /* espacio entre el nombre y el botón */
  font-weight: bold;
  color: #333;
}

.btn-logout{
  display: inline-block;
  padding: 6px 12px;
  background-color: #c0392b; /* rojo */
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9em;
  transition: background-color 0.2s ease;
}

.btn-logout:hover{
  background-color: #a93226;
}

/* Mejora visual de la ficha del cliente */
.cliente-info {
  background: #ffffff;
  border: 1px solid #dbe6f1;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cliente-info h2 {
  margin-bottom: 16px;
  color: #294861;
  font-size: 1.3rem;
  border-bottom: 1px solid #e5ecf3;
  padding-bottom: 6px;
}

/* Usa grid para alinear clave y valor */
.cliente-info p {
  display: grid;
  grid-template-columns: 180px 1fr; /* ancho fijo para la clave */
  margin: 6px 0;
  font-size: 0.95rem;
}

.cliente-info p strong {
  color: #3c5f7f;
  font-weight: 600;
}

.cliente-info a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.cliente-info a:hover {
  text-decoration: underline;
}

/* ==== Vista de Reporte (sobrescribe a main) ==== */
.reporte-container {
  max-width: 1400px;   /* más ancho para que las tablas respiren */
  padding: 30px 40px;  /* más aire alrededor */
}

.modal-eliminar {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}

.modal-eliminar.oculto {
  display: none;
}

.modal-eliminar-contenido {
  background: #fff;
  padding: 20px 25px;
  border-radius: 8px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.modal-eliminar-botones {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

.boton-formular-pago.boton-deshabilitado {
  background-color: #9ca3af;   /* gris */
  border-color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;        /* evita el click */
}

/* por si tienes hover general, que no cambie al pasar el ratón */
.boton-formular-pago.boton-deshabilitado:hover {
  background-color: #9ca3af;
  border-color: #9ca3af;
}

.alerta-ok {
  color: #065f46;
}

.alerta-atraso {
  color: #b45309;
}

.alerta-atraso-grave {
  color: #b91c1c;
  font-weight: 600;
}

/* Panel de acciones del centro (esquina superior derecha) */
.centro-actions-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

/* Botones del panel: mismo ancho y tipografía consistente.
 NO tocamos background ni color, eso lo definen las clases existentes (.btn, .btn-agregar-mov, etc.) */
.btn-centro {
  width: 190px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
}

/* Quitar márgenes de los forms para que no desacomoden el stack */
.centro-actions-panel form {
  margin: 0;
  padding: 0;
}

.boton-nuevo-centro-wrapper {
  width: 100%;
  display: flex;
  justify-content: flex-end; /* Lo manda a la derecha */
  margin-top: 25px; /* Separación hacia arriba */
}

.boton-nuevo-centro-wrapper .btn-centro {
  padding: 14px 22px;     /* Igual que el estilo del sistema */
  border-radius: 10px;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.brand-link h1 {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.brand-link h1:hover {
  opacity: 0.75;
}

.boton-rojo {
  background-color: #c62828; /* rojo elegante */
  color: #fff;
}

.boton-rojo:hover {
  background-color: #b71c1c;
}

/* Botón rojo (si ya lo tienes, ignora este bloque) */
.boton-rojo {
  background-color: #c62828;
  color: #fff;
}
.boton-rojo:hover {
  background-color: #b71c1c;
}

/* Modal sistema (triple confirmación) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 40px rgba(0,0,0,0.2);
  padding: 16px 16px 12px;
}

.modal-box h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
}

.modal-box p {
  margin: 0 0 14px 0;
  color: #374151;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-modal {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.btn-modal:hover {
  opacity: 0.9;
}

.btn-modal-danger {
  border: 1px solid #b71c1c;
  background: #c62828;
  color: #fff;
}

/* Forzar texto blanco en botones tipo <a> dentro de la ficha (.cliente-info) */
.cliente-info .botones-reporte a.boton-formular-pago,
.cliente-info .botones-reporte a.boton-formular-pago:visited,
.cliente-info .botones-reporte a.boton-formular-pago:hover,
.cliente-info .botones-reporte a.boton-formular-pago:active {
  color: #fff !important;
  text-decoration: none;
}

.adelantar-toggle{
  display: flex;         /* sobreescribe el label {display:block} global */
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin: 0;
}

.adelantar-toggle input{
  width: auto;           /* evita que intente “ocupar 100%” */
}

.adelantar-ayuda{
  display: block;
  margin-top: 6px;
  font-size: 0.9em;
  color: #555;
}

/* Login bloqueado (fuerza bruta) */
.login-locked {
  opacity: 0.75;
}

.login-locked input,
.login-locked button {
  cursor: not-allowed;
  filter: grayscale(70%);
}

.lock-hint {
  margin-top: 10px;
  font-size: 0.95em;
  color: #444;
  text-align: center;
}

/* =========================
   DASHBOARD (nuevo)
   ========================= */

   .dash-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    margin: 18px 0 10px;
  }
  .dash-head__title{
    margin:0;
    font-size: 22px;
  }
  .dash-head__subtitle{
    margin:6px 0 0;
    opacity: .8;
  }
  
  /* filtros compactos */
  .filters--compact{
    align-items:end;
  }
  .filters--compact .field{
    min-width: 180px;
  }
  
  /* KPI cards estilo “reporte” */
  .kpi-grid{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 14px 0 18px;
  }
  
  .kpi-card{
    border-radius: 10px;
    overflow:hidden;
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
    border: 1px solid rgba(0,0,0,.06);
    background: #fff;
  }
  
  .kpi-card__top{
    padding: 16px 16px 10px;
    background: #eef2f6;
    text-align:center;
  }
  .kpi-card__title{
    margin:0;
    font-size: 14px;
    letter-spacing: .6px;
    opacity:.85;
  }
  .kpi-card__amount{
    margin-top: 8px;
    font-size: 28px;
    font-weight: 800;
  }
  
  .kpi-card__bottom{
    padding: 12px 16px;
    background: rgba(0,0,0,.06);
  }
  
  .kpi-row{
    display:flex;
    justify-content:space-between;
    gap: 10px;
    padding: 6px 0;
  }
  .kpi-row__label{ opacity:.85; }
  .kpi-row__value{ font-weight:700; }
  
  /* variantes */
  .kpi-card--blue .kpi-card__top{
    background: rgba(27, 77, 140, .10);
  }
  .kpi-card--gray .kpi-card__top{
    background: #eef2f6;
  }
  .kpi-card--green .kpi-card__top{
    background: rgba(29, 185, 84, .22);
  }
  .kpi-card--green .kpi-card__bottom{
    background: rgba(29, 185, 84, .14);
  }
  
  /* Panel de gráfica más grande */
  .chart-panel{
    margin-top: 12px;
  }
  .chart-wrap--tall{
    height: 420px;
  }
  
  /* Responsivo */
  @media (max-width: 1024px){
    .kpi-grid{
      grid-template-columns: 1fr;
    }
    .chart-wrap--tall{
      height: 360px;
    }
  }
  
  /* ===== Dashboard filtros: barra limpia ===== */
.dash-filters.panel{
  padding: 14px 16px;
}

.filters.filters--compact{
  display: grid;
  grid-template-columns: 220px 220px 180px 180px 1fr;
  gap: 12px;
  align-items: end;
}

.filters.filters--compact .field{
  min-width: 0;
}

.filters.filters--compact .label{
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  display: block;
}

.filters.filters--compact .input{
  width: 100%;
}

.filters.filters--compact .field--actions{
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: end;
}

@media (max-width: 1100px){
  .filters.filters--compact{
    grid-template-columns: 1fr 1fr;
  }
  .filters.filters--compact .field--actions{
    justify-content: flex-start;
  }
}

@media (max-width: 520px){
  .filters.filters--compact{
    grid-template-columns: 1fr;
  }
}

/* Resaltar Gestión de Ingresos de forma sutil */
.menu-card--ingresos {
  border: 2px solid #4caf50;
}

/* Color rojo corporativo para el título del header */
.site-header .brand-link h1 {
  color: #c62828; /* rojo elegante, no chillón */
}

/* ================================
   DESMENUZADO: mini KPI en celdas (v2)
   ================================ */

   .table--desmenuzado td,
   .table--desmenuzado th {
     vertical-align: middle;
   }
   
   /* Fondo blanco sólido para la tabla completa */
.table--desmenuzado{
  background: #ffffff;                 /* ✅ full blanco */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);  /* separación suave */
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

   
   /* Centrar la tabla dentro del wrapper */
   #panelDesmenuzado .table-wrap {
     display: flex;
     justify-content: center;
   }
   
   #tablaDesmenuzado.table--desmenuzado {
     width: fit-content;      /* evita que se estire a lo loco */
     max-width: 100%;
   }
   
   /* Compacta el padding en TODAS las celdas del desmenuzado */
   .table--desmenuzado td {
     padding: 10px 8px;
   }
   
   /* Bloque interno de cada celda */
   .table--desmenuzado .cell-stack {
     display: grid;
     grid-template-rows: repeat(3, auto);
     gap: 6px;
     line-height: 1.15;
     min-width: 86px;
   }
   
   /* Cada renglón (Ingreso/Gasto/Neto) ahora es VERTICAL:
      palabra arriba, valor abajo */
   .table--desmenuzado .cell-line {
     display: grid;
     grid-template-columns: 1fr;  /* ya no 2 columnas */
     gap: 2px;
     padding: 6px 8px;
     border-radius: 10px;
     background: rgba(0,0,0,0.035);
     text-align: center;          /* centra etiqueta y valor */
   }
   
   /* Etiqueta arriba */
   .table--desmenuzado .cell-label {
     font-size: 11px;
     opacity: 0.80;
     white-space: nowrap;
   }
   
   /* Valor abajo */
   .table--desmenuzado .cell-value {
     font-size: 12px;
     font-weight: 800;
     white-space: nowrap;
     text-align: center;
   }
   
   /* Diferencia leve entre líneas (muy sutil) */
   .table--desmenuzado .cell-line--ing { background: rgba(0,0,0,0.03); }
   .table--desmenuzado .cell-line--gas { background: rgba(0,0,0,0.035); }
   .table--desmenuzado .cell-line--neto { background: rgba(0,0,0,0.04); }
   
   /* Alineación del texto "Proyecto" */
   .table--desmenuzado td:first-child {
     white-space: nowrap;
   }
   
   /* Ajustes para pantallas angostas */
   @media (max-width: 900px) {
     #tablaDesmenuzado.table--desmenuzado { width: 100%; } /* en móvil mejor ocupar ancho */
     .table--desmenuzado td { padding: 8px 6px; }
     .table--desmenuzado .cell-stack { gap: 5px; min-width: 78px; }
     .table--desmenuzado .cell-line { padding: 5px 6px; }
     .table--desmenuzado .cell-label { font-size: 10px; }
     .table--desmenuzado .cell-value { font-size: 11px; }
   }
   
   /* ================================
   Dashboard Ingresos: layout ancho
   (solo esta vista)
   ================================ */

.page--wide {
  max-width: 1200px;   /* prueba 1300–1600 según gusto */
  margin: 20px auto;
  padding: 30px 40px;
}

/* Recuadro: Fuente de ingreso (gastos-registro) */
.source-box {
  border: 2px solid #cfd6dd;          /* más grueso */
  border-radius: 12px;
  padding: 18px 16px 14px;
  width: 100%;
  background: #fafbfd;                /* contraste leve */
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Título del recuadro */
.source-box legend {
  padding: 0 10px;
  font-weight: 700;                   /* más negrita */
  font-size: 1.05rem;                 /* más grande */
  color: #2c3e50;
}

/* Contenido interno en columna */
.source-box-body {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

/* Limpieza interna */
.source-box .form-group {
  margin: 0;
}

/* Scroll solo para la tabla de pagos del dashboard */
#panelPagosDashboard .table-wrap{
  max-height: 420px;
  overflow-y: auto;
}

#panelPagosDashboard thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}