/* General Body Styling */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.helper-text {
  display: block;
  font-size: 0.85em;
  color: #666;
  margin-top: 4px;
}

.form-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.error-text {
  color: #dc3545;
  font-size: 0.85em;
  margin-top: 4px;
  display: none;
}

.error-text.active {
  display: block;
}


/* Main Content Area */
main {
    flex: 1;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* Conteos Section */
#conteos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.rectangulo {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.rectangulo:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.rectangulo i {
    font-size: 2.5em;
    color: #007bff;
    margin-bottom: 10px;
}

.rectangulo h3 {
    margin: 5px 0;
    font-size: 1.5em;
    color: #007bff;
}
.rectangulo h3 span {
    color: #007bff;
}
#sueldo-estimado{
    grid-column: span 2;
}
#sueldo-estimado i {
    color: #28a745;
}
#sueldo-estimado h3 span {
    color: #28a745;
}

.rectangulo p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

/* Last Notes Section */
#ultimasNotas {
    text-align: left;
    grid-column: span 2;
}

#ultimasNotas h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

#listaNotas {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9em;
}

#listaNotas li {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: #444;
}

/* --- Modal Styling for "modalAgregarGrupo" --- */
.modal {
    display: none; /* Asegura que no estorbe cuando no está activo */
    position: fixed; /* Esto es FUNDAMENTAL para que se superponga */
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease-out;
    padding: 10px;
    box-sizing: border-box;
}

/* Si tu JS añade la clase 'active' al modal cuando está abierto */
.modal.active {
    display: flex; /* Ahora sí usa flexbox para centrar y se superpone */
    opacity: 1; /* Para la animación fadeIn */
}


.modal-content {
    background-color: #ffffff;
    margin: auto; /* Para centrar el bloque modal-content */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    position: relative;
    width: 90%;
    max-width: 550px;
    animation: slideIn 0.4s ease-out;
    transform: translate(-50%, -50%); /* Ajuste inicial para slideIn */
    top: 50%;
    left: 50%;
    box-sizing: border-box;
}

.close {
    color: #555;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.close:hover,
.close:focus {
    color: #007bff;
    text-decoration: none;
}

.modal-content h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
    font-weight: 700;
}

.modal-content label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #34495e;
    font-size: 1.05em;
}

.modal-content input[type="number"],
.modal-content input[type="text"],
.modal-content input[type="date"] {
    width: calc(100% - 24px);
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid #c0c0c0;
    border-radius: 8px;
    font-size: 1.05em;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.modal-content input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

/* Tooltip Styling */
.tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.tooltip-container input {
    margin-bottom: 0;
    flex-grow: 1;
}

.tooltip-icon {
    margin-left: 10px;
    color: #888;
    cursor: pointer;
    font-size: 1.1em;
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 2;
    left: 105%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 0.9em;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Buttons */
.botonAjustes {
    background: linear-gradient(to right, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;    
    width: 100%;
}

.botonAjustes i {
    margin-right: 8px;
}

.botonAjustes:hover {
    background: linear-gradient(to right, #0056b3 0%, #007bff 100%);
    transform: translateY(-2px);
}

#botonAgregarGrupo {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: fixed;
    bottom: 20px;
    right: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 999;
}

#botonAgregarGrupo:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    /* Header styles moved to appbar.css */
    #conteos {
        grid-template-columns: repeat(2, 1fr);
    }
    #ultimasNotas {
        grid-column: span 2;
    }
    .rectangulo {
        padding: 15px;
    }

    /* Modal Responsive Styles */
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 5px;
        max-width: none;
        overflow-y: auto;
        animation: slideInFromBottom 0.4s ease-out;
        padding: 20px;
        transform: none;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .modal-content h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }

    .modal-content label {
        font-size: 1em;
    }

    .modal-content input {
        padding: 12px;
        font-size: 1em;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }

    /* Tooltip positioning for small screens */
    .tooltip-text {
        left: 50%;
        top: calc(100% + 10px);
        transform: translateX(-50%);
        width: 90%;
    }

    #botonAgregarGrupo {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
        font-size: 2.2em;
    }
}

/*@media (max-width: 400px) {
    #conteos {
        grid-template-columns: 1fr;
    }
    #ultimasNotas {
        grid-column: span 1;
    }
    .modal-content {
        padding: 15px;
    }
    .modal-content h2 {
        font-size: 1.4em;
    }
}*/

/* --- Keyframe Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -40%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animar Sueldo Total*/
#sueldoTotal.animado {
  animation: pulsoSueldo 0.5s ease-out;
}

@keyframes pulsoSueldo {
  0% {
    transform: scale(1);
    color: inherit;
  }
  50% {
    transform: scale(1.3);
    color: #28a745; /* Verde suave al animar */
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}
/*para edit*/
/* === Tabla Edición Estilos Responsivos === */
#tablaEdicion {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem auto;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.95rem;
}

#tablaEdicion thead {
  background-color: #007bff;
  color: #fff;
}

#tablaEdicion th,
#tablaEdicion td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

#tablaEdicion input {
  width: 100%;
  padding: 6px;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

#tablaEdicion button {
  background-color: #dc3545;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#tablaEdicion button:hover {
  background-color: #c82333;
}

/* Botón principal */
button[onclick="guardarCambios()"] {
  display: block;
  margin: 20px auto;
  padding: 12px 24px;
  background-color: #007bff;
  color: white;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  max-width: 300px;
}

button[onclick="guardarCambios()"]:hover {
  background-color: #0056b3;
}

/* === Responsivo para móviles === */
@media screen and (max-width: 768px) {
  #tablaEdicion thead {
    display: none;
  }

  #tablaEdicion, 
  #tablaEdicion tbody, 
  #tablaEdicion tr, 
  #tablaEdicion td {
    display: block;
    /*width: 100%;*/
  }

  #tablaEdicion tr {
    margin-bottom: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }

  #tablaEdicion td {
    text-align: right;
    padding-left: 50%;
    position: relative;
  }

  #tablaEdicion td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    color: #333;
  }

  #tablaEdicion input {
    font-size: 0.95rem;
  }
}

/* Boton Atras */
.botonFlotanteIzquierda {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(to right, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 1000;
  transition: background 0.3s ease;
}

.botonFlotanteIzquierda:hover {
  background-color: #0056b3;
}

.rectangulo.calculadora {
    position: relative;
    /* Los otros estilos que ya tengas para el card */
    /* por ejemplo: padding, box-shadow, width, etc. */
}

/*ocultar sueldo*/
.toggle-button {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 0.7em; /* Ajusta el tamaño del ojo */
        color: #666; /* Color del ojo */
        position: absolute; /* Para colocarlo en una esquina */
        right: 25px;
        z-index: 10;
    }
    .toggle-button i {
        pointer-events: none; /* Asegura que el clic lo reciba el botón, no el icono */
    }
