body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121826; /* Fondo oscuro principal */
    color: #f0f0f0; /* Texto claro */
    min-height: 100vh;
    margin: 0;
}

/* Estilos para el cuerpo de las páginas del backoffice */
.backoffice-body {
    display: flex;
}

/* Estilos para las páginas que no son del backoffice (como el panel principal) */
.client-section {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinea arriba para formularios largos */
    padding: 20px;
    box-sizing: border-box;
}

.calculator-container {
    background-color: #1a253c; /* Fondo del contenedor */
    padding: 30px;
    border-radius: 12px;    margin: 0 auto; /* Centra el contenedor horizontalmente */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
}

/* Ancho para los contenedores principales dentro del backoffice */
.main-content .calculator-container {
    max-width: 1360px; /* Ancho aumentado */
}

/* Ancho específico para las páginas de gestión */
body.client-section .calculator-container {
    max-width: 800px;
}

.update-date-display {
    text-align: right;
    color: #a9c1e8;
    margin-top: 20px;
    margin-bottom: 15px;
    font-style: italic;
    font-size: 0.9em;
}

.ipc-increase-display {
    text-align: center;
    color: #a7f3d0;
    font-size: 1.1em;
    font-weight: bold;
    padding: 12px;
    background-color: #121826;
    border-radius: 8px;
    margin-top: 0;
}

h1 {
    color: #ffffff;
    text-align: center;
    margin-top: 0;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="password"], 
input[type="email"],
input[type="url"],
input[type="number"], select {
    width: 100%;
    padding: 10px;
    border: 1px solid #3a506b;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #121826;
    color: #f0f0f0;
    font-size: 14px; /* Unificar tamaño de fuente */
    line-height: 1.5; /* Unificar altura de línea */
    height: 44px; /* Altura fija para unificar todos los campos */
}

input:disabled {
    background-color: #2c3a56; /* Un azul ligeramente más claro y apagado */
    color: #a9c1e8;
    cursor: not-allowed;
    opacity: 0.7;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #3a506b;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #121826;
    color: #f0f0f0;
    font-family: inherit; /* Heredar la fuente del body */
    resize: vertical; /* Permitir redimensionar verticalmente */
}

.logo-upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-upload-group {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 44px; /* Alinear altura con otros inputs */
}

#logoPreview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #121826;
    border: 1px solid #3a506b;
}

/* Ocultar el input de archivo real pero mantenerlo funcional */
.input-file-hidden {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

/* El label se estiliza con las clases de botón existentes */
.logo-upload-container .btn-secondary,
.file-upload-group .btn-secondary {
    margin: 0; /* Resetear margen del botón */
}

.file-name {
    color: #a9c1e8;
    font-size: 0.9em;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px; /* Ajustar según sea necesario */
}

.date-range {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.date-range select {
    width: 49%;
    display: inline-block;
    margin-right: 2%;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #3b82f6; /* Azul más vibrante */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #2563eb;
}

hr {
    border: none;
    border-top: 1px solid #3a506b;
    margin: 30px 0;
}

#resultado {
    margin-top: 25px;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.accordion-container {
    margin-top: 20px;
}

.accordion {
    margin-bottom: 10px;
    border: 1px solid #3a506b;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    background-color: #1a253c;
    color: #a9c1e8;
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.accordion-header:hover, .accordion-header.active {
    background-color: #2c3a56;
}

.accordion-icon {
    font-size: 1.5em;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.accordion-header.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    padding: 0 18px;
    background-color: #1a253c;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.accordion-content button {
    margin-top: 5px;
    margin-bottom: 18px;
}

.success { background-color: #164e3b; color: #a7f3d0; border: 1px solid #059669; }
.error { background-color: #7f1d1d; color: #fecaca; border: 1px solid #dc2626; }
.result-details { text-align: left; font-size: 1em; font-weight: normal; }
.result-details div { display: flex; justify-content: space-between; padding: 8px 0; }
.result-details span { color: #a9c1e8; }
.result-details strong { font-weight: bold; }
.result-hr { border: none; border-top: 1px solid #3a506b; margin: 5px 0; }
.increase-percent { color: #a7f3d0; font-size: 1.1em; }

/* Ocultar flechas en los campos de tipo número */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* --- Loader / Spinner --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 24, 38, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Aumentado para estar sobre el modal */
    transition: opacity 0.3s ease;
}

.spinner {
    border: 4px solid rgba(240, 240, 240, 0.3);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Loader / Spinner --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 24, 38, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Aumentado para estar sobre el modal */
    transition: opacity 0.3s ease;
}

.spinner {
    border: 4px solid rgba(240, 240, 240, 0.3);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Botón de Copiar --- */
.result-line-copy { display: flex; justify-content: space-between; align-items: center; }
#copyBtn { background: #3a506b; border: none; color: #a9c1e8; padding: 5px 10px; border-radius: 5px; cursor: pointer; margin: 0; width: auto; font-size: 0.8em; min-width: 80px; text-align: center; }
#copyBtn:hover { background: #2c3a56; }
#copyBtn svg { vertical-align: middle; }

/* --- Botón de Copiar --- */
.result-line-copy { display: flex; justify-content: space-between; align-items: center; }
#copyBtn { background: #3a506b; border: none; color: #a9c1e8; padding: 5px 10px; border-radius: 5px; cursor: pointer; margin: 0; width: auto; font-size: 0.8em; min-width: 80px; text-align: center; }
#copyBtn:hover { background: #2c3a56; }
#copyBtn svg { vertical-align: middle; }

.copy-buttons-container {
    display: flex;
    gap: 10px; /* Espacio entre los botones */
    margin-top: 15px;
    width: 100%;
    flex-wrap: wrap; /* Permite que los botones pasen a la siguiente línea si no caben */
}

.copy-buttons-container .btn-copiar {
    flex-grow: 1; /* Hace que ambos botones ocupen el espacio disponible */
    flex-basis: 200px; /* Base de ancho antes de crecer */
}

/* --- Estilos para la tabla de clientes y highlights --- */
.client-name-highlight {
    color: #7dd3fc; /* Un azul claro para destacar */
    font-weight: bold;
}

.table-container {
    margin-top: 25px;
    overflow-x: auto; /* Para que la tabla sea responsive en móviles */
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #3a506b;
}

thead th {
    background-color: #2c3a56;
    color: #a9c1e8;
    font-weight: 600;
}

th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none; /* Evita que el texto se seleccione al hacer clic */
}

th.sortable:hover {
    background-color: #3a506b; /* Un tono ligeramente más claro */
}

.sort-arrow {
    display: inline-block;
    color: #7dd3fc; /* Un azul claro para que destaque */
    width: 1em; /* Reservar un ancho fijo para la flecha */
    text-align: left;
}

tbody tr:hover {
    background-color: #212d47;
}

.valor-ajustado {
    font-weight: bold;
    color: #a7f3d0; /* Mismo color que el porcentaje de aumento */
}

/* --- Estilos para la tabla de cálculo desplegable --- */
.trabajo-principal {
    cursor: pointer;
    background-color: #212d47;
}

.trabajo-principal:hover {
    background-color: #2c3a56;
}

.toggle-icon {
    display: inline-block;
    width: 20px;
    font-weight: bold;
    font-size: 1.2em;
}

.sub-item td {
    padding-left: 40px; /* Indentación para los sub-ítems */
    background-color: rgba(18, 24, 38, 0.5);
    border-bottom-color: #2c3a56;
}

/* --- Estilos para la navegación de clientes --- */
.client-navigation {
    display: flex;
    align-items: flex-end; /* Alinea la parte inferior de los elementos */
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.client-navigation .input-group {
    flex-grow: 1;
    margin-bottom: 0;
}

.client-navigation #btnGestionarClientes {
    width: auto; /* Ancho automático para el botón */
    padding: 10px 15px;
    margin-top: 0;
    white-space: nowrap; /* Evita que el texto del botón se parta */
    text-decoration: none; /* Quitar subrayado del enlace */
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 15px;
}

/* --- Estilos para la página de Gestión --- */
.client-list {
    list-style: none;
    padding: 0;
}

.client-item {
    background-color: #2c3a56;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.client-item span {
    font-weight: 600;
    flex-grow: 1;
}

/* Estilos base para todos los botones de acción personalizados */
.btn-main-action,
.btn-secondary,
.btn-edit,
.btn-delete {
    width: auto;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border: none;
    display: inline-block;
}

.client-actions > * {
    margin-left: 10px;
}

.btn-main-action {
    background-color: #166534;
}

.btn-secondary { background-color: #3a506b; }
.btn-secondary:hover {
    background-color: #4b6a8e;
}

.btn-edit { background-color: #f59e0b; }
.btn-edit:hover { background-color: #d97706; }

.btn-restore { background-color: #16a34a; }
.btn-restore:hover { background-color: #15803d; }

.btn-delete { background-color: #ef4444; }
.btn-delete:hover { background-color: #dc2626; }

/* --- Estilos para el Modal --- */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 24, 38, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background-color: #1a253c;
    padding: 30px;
    border: 1px solid #3a506b;
    width: 100%;
    max-width: 700px;
    border-radius: 12px;
    position: relative;
    margin: 10px 0;
    max-height: calc(100% - 20px); /* Ajustar para el margen vertical */
    overflow-y: auto;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}
.modal-actions button { width: auto; }

.trabajo-group {
    background-color: #121826;
    border: 1px solid #3a506b;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.trabajo-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.trabajo-header input { flex-grow: 1; }
.btn-remove-trabajo { background-color: #7f1d1d; width: auto; padding: 8px; font-size: 12px; line-height: 1; margin-top: 0; }

.items-container { margin-left: 20px; border-left: 2px solid #3a506b; padding-left: 15px; }
.costo-item { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.costo-item input:first-child { flex-basis: 60%; }
.costo-item input:nth-child(2) { flex-basis: 30%; }
.btn-remove-item { background-color: #7f1d1d; width: auto; padding: 8px; font-size: 12px; line-height: 1; margin-top: 0; }
.btn-agregar-item { width: auto; padding: 8px 12px; font-size: 14px; margin-top: 10px; }

/* --- Estilos para Notificación Toast --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 120%); /* Empieza fuera de la pantalla */
    background-color: #166534; /* Verde éxito */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10002; /* Aumentado para estar sobre el loader */
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    font-weight: 600;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.toast-error {
    background-color: #991b1b; /* Rojo error */
}

/* --- Estilos para el botón de Guardar Valores --- */
.save-button-container {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Unificar el tamaño de los botones de acción en el contenedor de guardado */
.save-button-container > a,
.save-button-container > button {
    padding: 12px 20px;
    font-size: 16px;
    margin-top: 0;
}

/* --- Estilos para el Gráfico --- */
.chart-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #121826;
    border-radius: 8px;
    border: 1px solid #3a506b;
    height: 400px; /* Altura fija para el contenedor del gráfico */
}

.chart-container h2 {
    margin-top: 0;
    color: #a9c1e8;
    font-weight: 600;
}

#ipcChart {
    max-height: 300px;
}

/* --- Estilos para el selector de tipo de gráfico --- */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.chart-header h2 {
    margin: 0;
    flex-grow: 1;
    text-align: left;
}

.chart-type-selector {
    display: flex;
    gap: 5px;
    background-color: #1a253c;
    padding: 4px;
    border-radius: 8px;
}

.chart-type-selector label {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: #a9c1e8;
    font-size: 14px;
    font-weight: 500;
}

.chart-type-selector input[type="radio"] {
    display: none;
}

.chart-type-selector input[type="radio"]:checked + label {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- Estilos para valores ajustados editables --- */
.editable-valor-ajustado {
    background: transparent;
    border: none;
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    text-align: left;
    width: 100%;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.editable-valor-ajustado:focus {
    outline: none;
    background-color: #121826;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* --- Estilos para el Layout del Backoffice con Menú Lateral --- */

.backoffice-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.sidebar {
    width: 240px;
    background-color: #1a253c;
    border-right: 1px solid #3a506b;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    flex-shrink: 0; /* Evita que el sidebar se encoja */
}

.sidebar-header h3 {
    color: #ffffff;
    margin: 0 0 30px 0;
    text-align: center;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #a9c1e8;
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0; /* Evita que el ícono se encoja */
}

.sidebar-nav li a:hover {
    background-color: #2c3a56;
    color: #ffffff;
}

.sidebar-nav li.active a {
    background-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto; /* Empuja el footer hacia abajo */
}

.sidebar-footer .btn-secondary {
    width: 100%;
    text-align: center;
}

.user-info {
    border-top: 1px solid #3a506b;
    font-size: 0.9em;
    color: #a9c1e8;
    padding-top: 15px;
    margin-bottom: 15px;
}

.user-info span {
    display: block;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto; /* Mantenemos el scroll solo para el contenido */
}

.sidebar-divider {
    border: none;
    border-top: 1px solid #3a506b;
    margin: 15px 0;
}

/* --- Estilos para la página de Login --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.login-container {
    background-color: #1a253c;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 { margin-bottom: 10px; }
.login-container p { color: #a9c1e8; margin-bottom: 30px; }
.login-container .input-group { text-align: left; }

.password-policy {
    font-size: 0.85em;
    color: #a9c1e8;
    text-align: left;
    margin-top: -10px; /* Reduce el espacio con el campo de arriba */
    margin-bottom: 15px;
    padding-left: 5px; /* Alinea con el texto de los inputs */
}

.error-container {
    background-color: #7f1d1d;
    color: #fecaca;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-align: center;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px; /* Dejar espacio para el botón */
}

.password-toggle-btn {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    width: 38px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #a9c1e8;
    margin: 0;
    padding: 0 10px;
}

.form-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #121826;
    border-radius: 8px;
}

/* --- Estilos para los requisitos de contraseña --- */
.password-requirements-list {
    background-color: rgba(18, 24, 38, 0.5);
/* --- Estilos para mostrar información estática --- */
.info-line {
    margin-top: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3a506b; /* Una línea separadora sutil */
    color: #a9c1e8; /* Color más claro, menos prominente */
    font-size: 1em;
}

.info-line strong {
    color: #f0f0f0;
    font-weight: 600;
    margin-right: 10px;
}
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    max-width: 500px;
    border: 1px solid #3a506b;
}

.password-requirements-list p {
    margin-top: 0;
    font-weight: 600;
}

.password-requirements-list ul {
    list-style: none;
    padding-left: 20px;
    margin: 0;
    font-size: 0.9em;
}

.password-requirements-list li {
    margin-bottom: 5px;
    color: #fca5a5; /* Rojo por defecto (inválido) */
    position: relative;
    transition: color 0.3s ease;
}

.password-requirements-list li::before {
    content: '✕'; /* Icono de cruz */
    position: absolute;
    left: -20px;
    color: #ef4444; /* Rojo */
    transition: all 0.3s ease;
}

.password-requirements-list li.valid {
    color: #a7f3d0; /* Verde (válido) */
}

.password-requirements-list li.valid::before {
    content: '✓'; /* Icono de check */
    color: #16a34a; /* Verde */
}

.requirement-feedback {
    font-size: 0.9em;
    margin-top: 5px;
    height: 1em; /* Reserva espacio para evitar saltos de layout */
}

.requirement-feedback.valid {
    color: #a7f3d0;
}

.requirement-feedback.invalid {
    color: #fca5a5;
}

/* --- Estilos para la Vista de Calendario IPC --- */
.ipc-calendar-view {
    background-color: #121826;
    border: 1px solid #3a506b;
    border-radius: 8px;
    padding: 20px;
}

.year-navigator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.year-navigator h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.8em;
    flex-grow: 1;
    text-align: center;
}

.year-nav-btn {
    background-color: #3a506b;
    border: none;
    color: #a9c1e8;
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 0;
    padding: 0;
    line-height: 40px;
}

.year-nav-btn:hover:not(:disabled) {
    background-color: #4b6a8e;
}

.year-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.month-btn {
    background-color: #2c3a56;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    width: 100%;
    border: 1px solid transparent;
    height: 75px; /* Altura fija para unificar el tamaño */
    justify-content: center; /* Centra el contenido verticalmente */
}

.month-btn span {
    font-weight: 600;
    color: #a9c1e8;
}

.month-btn strong {
    font-size: 1.2em;
    color: #a7f3d0;
}

.month-btn small {
    color: #6b7280;
    font-style: italic;
    /* Se eliminan los overrides para que la altura la controle el contenedor */
}

.month-btn.has-value:hover {
    background-color: #3a506b;
    border-color: #3b82f6;
}

.month-btn:disabled {
    background-color: #1a253c;
    opacity: 0.6;
    cursor: not-allowed;
}

.trabajo-group {
    background-color: #121826;
    border: 1px solid #3a506b;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.trabajo-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.trabajo-header input { flex-grow: 1; }
.btn-remove-trabajo { background-color: #7f1d1d; width: auto; padding: 8px; font-size: 12px; line-height: 1; margin-top: 0; }

.items-container { margin-left: 20px; border-left: 2px solid #3a506b; padding-left: 15px; }
.costo-item { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.costo-item select { flex-basis: 60%; }
.costo-item input { flex-basis: 30%; }
.btn-remove-item { background-color: #7f1d1d; width: auto; padding: 8px; font-size: 12px; line-height: 1; margin-top: 0; }
.btn-agregar-item { width: auto; padding: 8px 12px; font-size: 14px; margin-top: 10px; }

.session-expired-message {
    background-color: rgba(251, 191, 36, 0.1);
    color: #facc15;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    text-align: center;
}

/* --- Estilos para el Acordeón de Configuración --- */
.accordion-container {
    margin-top: 20px;
}

.accordion {
    border: 1px solid #3a506b;
    border-radius: 8px;
    overflow: hidden; /* Clave para que el max-height funcione */
    background-color: #1a253c;
}

.accordion-header {
    background-color: transparent;
    color: #a9c1e8;
    cursor: pointer;
    padding: 18px 20px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.accordion-header:hover, .accordion-header.active {
    background-color: #2c3a56;
}

.accordion-icon {
    font-size: 1.5em;
    font-weight: 300;
    line-height: 1;
}

.accordion-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

/* --- Spinner para botones --- */
.btn-spinner {
    display: none; /* Oculto por defecto */
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-loading .btn-spinner {
    display: inline-block;
}

/* --- Estilos para la insignia de estado --- */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-active {
    background-color: #166534; /* Verde oscuro */
    color: #a7f3d0; /* Verde claro */
}

.status-badge.status-inactive {
    background-color: #7f1d1d; /* Rojo oscuro */
    color: #fecaca; /* Rojo claro */
}

/* --- Estilos para la Página de Error 404 --- */
.error-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 90vh;
    padding: 20px;
    box-sizing: border-box;
}

.error-content {
    max-width: 600px;
}

.error-content h1 {
    font-size: 8em;
    color: #3b82f6;
    margin: 0;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    animation: pulse 2s infinite;
}

.error-content h2 {
    font-size: 2em;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 15px;
}

.error-content p {
    color: #a9c1e8;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

.error-content .btn-main-action {
    width: auto;
    padding: 12px 25px;
    font-size: 1.1em;
    text-decoration: none;
    background-color: #166534;
}

/* Animación del Cohete */
.rocket-container {
    margin-bottom: 20px;
    animation: float 6s ease-in-out infinite;
}

.rocket {
    position: relative;
    width: 80px;
    height: 150px;
    margin: 0 auto;
}

.rocket-body {
    width: 80px;
    height: 120px;
    background: #e0e0e0;
    border-radius: 50% 50% 10% 10% / 60% 60% 40% 40%;
    position: absolute;
    bottom: 0;
    border: 3px solid #b0b0b0;
}

.window {
    width: 30px;
    height: 30px;
    background: #3b82f6;
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid #b0b0b0;
}

.fin { width: 0; height: 0; border-style: solid; position: absolute; bottom: 10px; }
.fin-left { border-width: 0 30px 40px 0; border-color: transparent #ef4444 transparent transparent; left: -25px; }
.fin-right { border-width: 0 0 40px 30px; border-color: transparent transparent transparent #ef4444; right: -25px; }
.flame { position: absolute; bottom: -40px; left: 50%; transform: translateX(-50%); width: 20px; height: 50px; background: orange; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; animation: flicker 0.2s infinite; }


/* --- Estilos para filas de formulario --- */
.form-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.form-row .input-group {
    flex: 1;
}
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-20px); } 100% { transform: translateY(0px); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes flicker { 0% { transform: scale(1, 1) translateX(-50%); } 50% { transform: scale(1.1, 0.8) translateX(-50%); } 100% { transform: scale(1, 1) translateX(-50%); } }

/* --- Estilos para el Date Picker Personalizado --- */

.date-picker-container {
    position: relative;
    width: 100%;
}

/* El input ocupa todo el contenedor, pero su apariencia por defecto está oculta */
.date-picker-container input[type="date"],
.date-picker-container input[type="month"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--input-bg-color, #121826); /* Color de fondo de los inputs generales */
    border: 1px solid var(--input-border-color, #3a506b); /* Color de borde de los inputs generales */
    border-radius: 6px;
    padding: 10px;
    width: 100%;
    color: var(--text-color, #f0f0f0);
    font-size: 14px;
    box-sizing: border-box; /* Importante para que el padding no afecte el ancho */
    line-height: 1.5; /* Asegura una altura consistente */
    color-scheme: dark; /* Sugiere al navegador usar su UI oscura para el calendario */
    height: 44px; /* Altura fija para unificar con otros campos */
}

.filter-controls {
    display: flex;
    gap: 20px;
    align-items: flex-end; /* Alinea los elementos en la parte inferior */
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px; /* Alinear con la base del input */
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6; /* Color del check */
}

.checkbox-group label {
    font-weight: 600;
}

.deleted-row td {
    text-decoration: line-through;
    color: #6b7280;
    font-style: italic;
    opacity: 0.7;
}

/* Oculta el ícono de calendario por defecto en Chrome/Safari/Edge */
.date-picker-container input[type="date"]::-webkit-calendar-picker-indicator,
.date-picker-container input[type="month"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Ícono de calendario personalizado */
.date-picker-container::after {
    content: '📅';
    font-size: 16px;
    color: #a9c1e8;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* Permite que el clic llegue al input de abajo */
}

/* --- Estilos para el Dashboard de Empleado --- */

.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.kpi-card {
    background-color: #121826;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #3a506b;
    text-align: center;
}

.kpi-card h3 {
    margin-top: 0;
    color: #a9c1e8;
    font-size: 1em;
    font-weight: 600;
}

.kpi-card p {
    margin-bottom: 0;
    font-size: 2.2em;
    font-weight: bold;
    color: #a7f3d0;
}

.date-filter-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-filter-btn {
    background-color: #2c3a56;
    color: #a9c1e8;
    border: 1px solid #3a506b;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    margin: 0;
    width: auto;
}

.date-filter-btn:hover {
    background-color: #3a506b;
    color: #ffffff;
}

.date-filter-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.period-display {
    text-align: center;
    color: #a9c1e8;
    font-style: italic;
    margin-bottom: 20px;
}

.client-logo-table {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #1d2d4d; /* Un fondo para cuando la imagen es transparente o no carga */
    vertical-align: middle;
}

/* Estilos para el logo en el menú lateral */
.sidebar-logo {
    display: block; /* Asegura que ocupe su propia línea */
    width: 50px;    /* Ancho del logo, puedes ajustarlo */
    height: auto;   /* Mantiene la proporción de la imagen */
    margin: 0 auto 10px; /* Centra el logo y le da un margen inferior */
}

.sidebar-header .app-title {
    margin-top: 0; /* Elimina el margen superior del título si lo tuviera */
}

/* --- Estilos para el Dashboard de Administrador --- */

.page-header .quick-actions {
    display: flex;
    gap: 10px;
}

.widgets-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.widget {
    background-color: #121826;
    border: 1px solid #3a506b;
    border-radius: 8px;
    padding: 20px;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #3a506b;
    padding-bottom: 10px;
}

.widget-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: #a9c1e8;
}

.widget-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}

.widget-link:hover {
    text-decoration: underline;
}

.widget-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #2c3a56;
}

.widget-list-item:last-child {
    border-bottom: none;
}

.widget-list-item a {
    text-decoration: none;
    color: inherit;
    flex-grow: 1;
}

.widget-list-item .item-title {
    display: block;
    font-weight: 600;
    color: #f0f0f0;
}

.widget-list-item .item-subtitle {
    font-size: 0.9em;
    color: #a9c1e8;
}

.widget-list-item .item-value {
    font-weight: 600;
    color: #a7f3d0;
    white-space: nowrap;
    margin-left: 15px;
}

.link-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.link-row .link-type {
    flex-basis: 30%;
}

.link-row .link-url {
    flex-grow: 1;
}

.link-row .remove-link-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 8px;
    line-height: 1;
}

#add-link-btn {
    width: auto;
    margin-top: 10px;
    font-size: 14px;
}

.link-row-employee-view {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre el icono y el texto */
    margin-bottom: 8px;
    padding: 5px 0;
}

.link-row-employee-view .link-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor; /* Asegura que el SVG herede el color del texto */
    flex-shrink: 0;
}

.link-row-employee-view .link-text {
    color: #7dd3fc; /* Un color que destaque para el enlace */
    text-decoration: none;
    word-break: break-all; /* Rompe palabras largas para evitar desbordamiento */
}

.link-row-employee-view .link-text:hover {
    text-decoration: underline;
}

.current-user-indicator {
    font-weight: bold;
    color: #a7f3d0;
    margin-left: 8px;
    font-size: 0.9em;
}