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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ===== NAVBAR Y MENÚ HAMBURGUESA ===== */
#navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-brand img {
    height: 35px;
    margin-right: 10px;
}

.user-info {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-left: 1rem;
    font-weight: normal;
    display: inline-block;
}

/* Menú Hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
    display: block;
}

/* Menú normal (desktop) */
.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
    white-space: nowrap;
    display: block;
}

.nav-link:hover, .nav-link.active {
    background: #34495e;
}

/* ===== MAIN CONTENT ===== */
#main-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

/* ===== ESTADOS GRID ===== */
.estados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.estado-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.estado-card:hover {
    transform: translateY(-2px);
}

.estado-card.pendiente { border-left: 4px solid #e74c3c; }
.estado-card.validacion { border-left: 4px solid #f39c12; }
.estado-card.derivadas { border-left: 4px solid #27ae60; }

.count {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-top: 0.5rem;
}

/* ===== TABLA DE SOLICITUDES ===== */
.solicitudes-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #34495e;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background: #f8f9fa;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.badge.estado-pendiente { background: #ffeaa7; color: #e17055; }
.badge.estado-en_validacion { background: #fab1a0; color: #d63031; }
.badge.estado-validado { background: #55efc4; color: #00b894; }
.badge.estado-derivado { background: #74b9ff; color: #0984e3; }

/* ===== BOTONES ===== */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

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

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

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

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    color: #7f8c8d;
}

.close:hover {
    color: #e74c3c;
}

/* ===== FORMULARIOS ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ===== GRID PARA FORMULARIO DE CLIENTE ===== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-full-width {
    grid-column: 1 / -1;
}

/* ===== AUTOCOMPLETADO ===== */
.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

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

/* ===== CLIENTE ENCONTRADO ===== */
.cliente-encontrado {
    background: #d4edda;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
}

.cliente-encontrado h4 {
    color: #155724;
    margin-bottom: 0.5rem;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 1024px) {
    #main-content {
        padding: 1.5rem;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    #navbar {
        padding: 0.8rem;
    }
    
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .nav-brand img {
        height: 30px;
        margin-right: 8px;
    }
    
    .user-info {
        font-size: 0.7rem;
        margin-left: 0.5rem;
    }
    
    /* Mostrar hamburguesa en mobile */
    .hamburger {
        display: flex;
        order: 2;
    }
    
    /* Ocultar menú normal en mobile */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
        border-top: 1px solid #34495e;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .nav-menu.active {
        display: flex;
        max-height: 300px;
    }
    
    .nav-link {
        width: 100%;
        text-align: left;
        padding: 1rem;
        border-radius: 4px;
        border: none;
        font-size: 1rem;
    }
    
    .nav-link:hover {
        background: #34495e;
    }
    
    #main-content {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .estados-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .estado-card {
        padding: 1rem;
    }
    
    .count {
        font-size: 1.5rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Mobile pequeño */
@media (max-width: 480px) {
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-brand img {
        height: 25px;
        margin-right: 5px;
    }
    
    .user-info {
        font-size: 0.65rem;
    }
    
    .hamburger {
        padding: 3px;
    }
    
    .hamburger span {
        width: 20px;
        height: 2px;
    }
    
    #main-content {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* ===== ANIMACIONES ===== */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Scroll personalizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none !important;
}
/* ===== ESTILOS PARA MODAL DE VALIDACIÓN ===== */
.validacion-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.validacion-option {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.validacion-option:hover {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.validacion-option.selected {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.option-icon {
    font-size: 2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.option-content h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.option-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive para modal de validación */
@media (max-width: 768px) {
    .validacion-option {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .option-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .option-content h3 {
        font-size: 1rem;
    }
    
    .option-content p {
        font-size: 0.85rem;
    }
}