/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header h1 {
    text-align: center;
    margin-bottom: 10px;
}

/* Navegación */
.nav {
    background-color: #34495e;
    padding: 0;
}

.nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav li {
    margin: 0;
}

.nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: #2c3e50;
}

/* Formularios */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 50px auto;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

/* NUEVO: diseño lindo para filas de formulario */
.card form .form-row { margin-bottom: 14px; }
.card form .form-row label { display:block; margin-bottom:6px; color:#334155; font-weight:600; }
.card form .form-row input,
.card form .form-row select,
.card form .form-row textarea { width:100%; padding:10px 12px; border:1px solid #d3d7db; border-radius:8px; background:#fff; font-size:15px; transition: all .2s ease; }
.card form .form-row input:focus,
.card form .form-row select:focus,
.card form .form-row textarea:focus { border-color:#0f62fe; box-shadow: 0 0 0 3px rgba(15,98,254,0.12); outline:none; }
.card form .form-row input::placeholder { color:#9aa0a6; }

/* NUEVO: caja de firma estilizada */
.signature-box { border:1px dashed #bfc5d2; border-radius:10px; background:#fbfdff; padding:10px; transition: border-color .2s ease, background .2s ease; }
.signature-box:hover { border-color:#94a3b8; background:#f7fbff; }
.signature-box .signature-actions { display:flex; justify-content:flex-end; }
.signature-box .signature-actions .btn-small { background:#e5e7eb; color:#111827; }

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}
/* Estado deshabilitado */
.btn:disabled,
.btn.btn-success:disabled,
.btn.btn-warning:disabled,
.btn.btn-danger:disabled {
    background-color: #c9ccd1 !important;
    border-color: #c9ccd1 !important;
    color: #6b7280 !important;
    cursor: not-allowed;
    opacity: 0.75;
}

/* NUEVO: botón secundario */
.btn-secondary { background-color:#64748b; }
.btn-secondary:hover { background-color:#4b5563; }

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

/* Tablas */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #34495e;
    color: white;
    font-weight: bold;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* Cards */
.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

/* Overlay de progreso para envíos */
.dialog-progress {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.dialog-progress .dialog-progress-box {
    background: #ffffff;
    color: #0b1a2b;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}
.dialog-progress .spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    position: relative;
    /* NUEVO: scroll adaptable dentro del modal */
    max-height: 86vh;
    overflow-y: auto;
    /* permitir scroll horizontal solo cuando sea necesario (tablas anchas) */
    overflow-x: auto;
}

/* Modal ancho adaptable para tablas largas (no rompe diseño en mobile) */
.modal-content.modal-wide {
    width: 96%;
    max-width: 1400px;
}

@media (max-width: 768px) {
    .modal-content.modal-wide {
        width: 96%;
        max-width: 100%;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Alertas */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Responsive */
@media (max-width: 768px) {
    .nav ul {
        flex-direction: column;
    }
    
    .nav a {
        text-align: center;
    }
    
    .container {
        padding: 10px;
    }
    
    .form-container {
        margin: 20px auto;
        padding: 20px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Botón flotante de WhatsApp */
.floating-whatsapp {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #25D366;
    color: #fff;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
    font-weight: 600;
    text-decoration: none;
    z-index: 1000;
}
.floating-whatsapp:hover {
    background: #1ebe57;
}

