* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1a3a8f 0%, #2a5baa 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

header .logo {
    font-size: 2.5rem;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #1a3a8f;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a3a8f;
    box-shadow: 0 0 0 2px rgba(26, 58, 143, 0.1);
}

.btn {
    background: #1a3a8f;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #2a5baa;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

thead {
    background: linear-gradient(135deg, #1a3a8f 0%, #2a5baa 100%);
    color: white;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}

th {
    font-weight: 600;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

.estado-cell {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estado-en-tiempo {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.estado-por-vencer {
    color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.estado-vencido {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.estado-pendiente {
    color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2rem;
    color: #1a3a8f;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #666;
    font-size: 0.9rem;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.legend {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.color-box {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.color-green {
    background-color: #28a745;
}

.color-yellow {
    background-color: #ffc107;
}

.color-red {
    background-color: #dc3545;
}

.color-orange {
    background-color: #fd7e14;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eaeaea;
    color: #666;
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.close-modal {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
}


.fecha-limite {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.fecha-limite.proxima {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.fecha-limite.vencida {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.fecha-limite.normal {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fecha-limite.indefinida {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Mejoras para tabla */
td.fecha-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Badges para estado */
.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* Tooltips mejorados */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    line-height: 1.4;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Responsive mejorado */
@media (max-width: 1200px) {
    .table-container {
        font-size: 0.9rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 992px) {
    .card {
        padding: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.5rem;
    }
}

/* Animaciones para alertas */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: fadeIn 0.3s ease-out;
}

/* Estilos para botones de acción */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Progress bars */
.progress {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar.success {
    background-color: #28a745;
}

.progress-bar.warning {
    background-color: #ffc107;
}

.progress-bar.danger {
    background-color: #dc3545;
}

/* Estados */
.estado-ok {
    color: #28a745;
}

.estado-advertencia {
    color: #ffc107;
}

.estado-error {
    color: #dc3545;
}

.estado-pendiente {
    color: #fd7e14;
}

/* Barra de progreso */
.progreso-contenedor {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progreso-bar {
    height: 100%;
    background-color: #28a745;
    transition: width 0.3s ease;
}

.progreso-bar.warning {
    background-color: #ffc107;
}

.progreso-bar.danger {
    background-color: #dc3545;
}

/* Alertas */
.alerta {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.alerta-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alerta-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alerta-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.cerrar-alerta {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
}

/* Filas que necesitan atención */
tr.necesita-atencion {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Botones de acción */
.acciones-cell {
    white-space: nowrap;
}

.btn-accion {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 1rem;
    margin: 0 2px;
    transition: all 0.2s;
}

.btn-accion:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-editar {
    color: #1a3a8f;
}

.btn-eliminar {
    color: #dc3545;
}

/* Información de plazos */
.info-plazos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.plazo-item {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1a3a8f;
}

.plazo-item h3 {
    margin-top: 0;
    color: #1a3a8f;
    font-size: 1.1rem;
}

.plazo-item p {
    margin-bottom: 0;
    color: #666;
    font-size: 0.95rem;
}

/* Previsualización */
.previsualizacion-resultado {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.previsualizacion-resultado h3 {
    margin-top: 0;
    color: #1a3a8f;
}

.resultado-detalle p {
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .table-container {
        font-size: 0.9rem;
    }

    .acciones-cell {
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .info-plazos {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
        font-size: 0.85rem;
    }

    .btn-accion {
        padding: 4px 6px;
        font-size: 0.9rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Agregar al archivo estilo.css */

.cargando {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.cargando i {
    margin-right: 10px;
}

.error-cell {
    background-color: #f8d7da;
    color: #721c24;
    text-align: center;
    padding: 1rem;
}

.text-center {
    text-align: center;
}

.debug-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.debug-info pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #e9ecef;
    padding: 1rem;
    border-radius: 3px;
    max-height: 300px;
    overflow-y: auto;
}

/* Estilos para datos indefinidos */
td:empty::before {
    content: "-";
    color: #999;
}

/* Estados */
.estado-en-tiempo {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.estado-por-vencer {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.estado-vencido {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.estado-pendiente {
    background-color: rgba(253, 126, 20, 0.1);
    color: #fd7e14;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.estado-desconocido {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

/* Fechas límite */
.fecha-limite {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.fecha-limite.normal {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.fecha-limite.tentativa {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.fecha-limite.indefinida {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.close-alerta {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: auto;
    color: inherit;
    opacity: 0.7;
}

.close-alerta:hover {
    opacity: 1;
}

/* Filas de error */
.error-row {
    background-color: rgba(220, 53, 69, 0.05) !important;
}

.error-cell {
    color: #dc3545;
    text-align: center;
    padding: 20px !important;
}

.error-cell i {
    margin-right: 8px;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .estado-cell span {
        font-size: 0.85rem;
        padding: 3px 6px;
    }

    .fecha-limite {
        font-size: 0.85rem;
        padding: 3px 6px;
    }
}