/* maestros/acuerdos.css */

#acuerdosScreen {
  position: relative;
}

#acuerdosScreen .grid-panel {
  background: linear-gradient(180deg, #1d3a6e 0%, #0f2f5d 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(12, 33, 69, 0.18);
  overflow: hidden;
}

#acuerdosScreen .grid-container {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

#acuerdosScreen .table-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 24px 24px;
  scrollbar-gutter: stable;
}

#acuerdosScreen .grid-footer {
  margin-top: auto;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.05);
  border-top: none;
  font-size: 0.875rem;
  color: var(--muted);
}

#acuerdosScreen .hidden {
  display: none !important;
}

/* Estilos para la barra de herramientas */
#acuerdosScreen .grid-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

/* Estilos para el título */
#acuerdosScreen .toolbar-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}

/* Estilos para los botones de acción */
#acuerdosScreen .toolbar-actions {
  display: flex;
  gap: 12px;
}

#acuerdosScreen .toolbar-actions button {
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  transition: transform 0.15s ease, background 0.15s ease;
}

#acuerdosScreen .toolbar-actions .primary {
  background: #4a6fa5;
}

#acuerdosScreen .toolbar-actions .primary:hover {
  background: #3d5f8f;
  transform: translateY(-1px);
}

#acuerdosScreen .toolbar-actions .danger {
  background: #c47a7a;
}

#acuerdosScreen .toolbar-actions .danger:hover {
  background: #b06a6a;
  transform: translateY(-1px);
}

#acuerdosScreen .toolbar-actions .danger.disabled {
  background: #6c757d;
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Estilos para el filtro */
#acuerdosScreen .grid-actions-row {
  padding: 16px 24px 0;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#acuerdosScreen .grid-actions-buttons {
  display: flex;
  gap: 12px;
}

#acuerdosScreen .grid-actions-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

#acuerdosScreen .grid-actions-row .search-label {
  width: 300px;
}

#acuerdosScreen .grid-actions-row label {
  color: #ffffff;
  font-weight: 500;
}

#acuerdosScreen .grid-actions-row input {
  width: 100%;
  max-width: 300px;
  background: rgba(244, 247, 255, 0.92);
  border: 1px solid rgba(15, 42, 98, 0.12);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
}

/* Estilos para la tabla */
#acuerdosScreen .data-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

#acuerdosScreen .data-grid th,
#acuerdosScreen .data-grid td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#acuerdosScreen .data-grid th {
  position: sticky;
  top: 0;
  background: #1d3a6e;
  color: #f7fbff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

#acuerdosScreen .data-grid th:last-child {
  border-right: none;
}

#acuerdosScreen .data-grid td {
  color: #f4f7ff;
  line-height: 1.2;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

#acuerdosScreen .data-grid td:last-child {
  border-right: none;
}

#acuerdosScreen .data-grid th:hover {
  background: rgba(255, 255, 255, 0.12);
}

#acuerdosScreen .data-grid td {
  color: #f4f7ff;
  line-height: 1.2;
}

/* Resaltado de fila al pasar el mouse - azul como en la imagen */
#acuerdosScreen .data-grid tbody tr {
  transition: background 0.16s ease;
  background: transparent;
}

#acuerdosScreen .data-grid tbody tr:hover {
  background: rgba(100, 140, 200, 0.25);
}

/* Indicadores de ordenamiento */
#acuerdosScreen .sort-indicator {
  margin-left: 4px;
  opacity: 0.5;
}

#acuerdosScreen .sort-asc .sort-indicator::after {
  content: "▲";
  opacity: 1;
}

#acuerdosScreen .sort-desc .sort-indicator::after {
  content: "▼";
  opacity: 1;
}

/* Estilos para las celdas editables */
#acuerdosScreen td[contenteditable="true"]:focus {
  outline: 2px solid rgba(0, 101, 213, 0.45);
  outline-offset: -2px;
  background: rgba(255, 255, 255, 0.08);
}

/* Estilos para el select de Cuenta Financiera */
#acuerdosScreen .editable-select {
  width: 100%;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background-color: #4a6fa5;
  color: #ffffff;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
  box-sizing: border-box;
  cursor: pointer;
}

#acuerdosScreen .editable-select option {
  background-color: #0d1e34;
  color: #f4f7ff;
}

#acuerdosScreen .editable-select:focus {
  outline: none;
  border-color: #5a82b8;
  box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.25);
}

/* Ajustes para mejor visualización de fechas */
#acuerdosScreen td[data-field="FechaFin"] {
  min-width: 120px;
  white-space: nowrap;
}

/* Ajustes para montos y tasas */
#acuerdosScreen td[data-field="Monto"],
#acuerdosScreen td[data-field="Tasa"] {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* Columna de selección */
#acuerdosScreen .data-grid td.select-col,
#acuerdosScreen .data-grid th.select-col {
  width: 40px;
  text-align: center;
  padding: 8px 8px;
}

#acuerdosScreen .data-grid td.select-col input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Estilos responsivos */
@media (max-width: 768px) {
  #acuerdosScreen .grid-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  #acuerdosScreen .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  #acuerdosScreen .table-wrapper {
    overflow-x: auto;
  }
  
  #acuerdosScreen .data-grid {
    min-width: 600px;
  }
}
