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

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

/* ===== NAVBAR Y MENÚ HAMBURGUESA ===== */
#navbar {
    background: #1a5c36;
    color: #ffffff;
    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.08);
    border-bottom: 1px solid #d0d7e0;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    flex: 1;
    color: #ffffff;
}

.nav-brand img {
    height: 35px;
    margin-right: 10px;
    filter: brightness(0) invert(1);
}

.user-info {
    font-size: 0.8rem;
    color: #c9e6d3;
    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: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
    display: block;
}

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

.nav-link {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background 0.2s;
    white-space: nowrap;
    display: block;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: #2a7a4c;
    border: 1px solid #3e8c5f;
}

.nav-link.active {
    background: #2a7a4c;
    border: 1px solid #3e8c5f;
    font-weight: 600;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #d0d7e0;
}

.header h1 {
    color: #1a5c36;
    font-size: 1.8rem;
    font-weight: 600;
}

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

.estado-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e1e4e8;
    border-top: 4px solid transparent;
}

.estado-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.estado-card.pendiente { 
    border-top-color: #c55a11; 
    border-left: none;
}
.estado-card.validacion { 
    border-top-color: #ed7d31; 
    border-left: none;
}
.estado-card.derivadas { 
    border-top-color: #2a7a4c; 
    border-left: none;
}

.count {
    font-size: 2.2rem;
    font-weight: 600;
    display: block;
    margin-top: 0.5rem;
    color: #201f1f;
}

/* ===== TABLA DE SOLICITUDES ===== */
.solicitudes-list {
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
    border: 1px solid #e1e4e8;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    font-size: 0.95rem;
}

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

th {
    background: #f2f2f2;
    color: #201f1f;
    font-weight: 600;
    position: sticky;
    top: 0;
    border-bottom: 2px solid #d0d7e0;
    border-top: 1px solid #d0d7e0;
}

tr {
    border-left: 1px solid transparent;
}

tr:hover {
    background: #f0f7ff;
    border-left: 3px solid #2a7a4c;
}

/* ===== BADGES ===== */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid transparent;
}

.badge.estado-pendiente { 
    background: #fff2cc; 
    color: #c55a11;
    border-color: #f4b183;
}
.badge.estado-en_validacion { 
    background: #fce4d6; 
    color: #ed7d31;
    border-color: #f4b183;
}
.badge.estado-validado { 
    background: #d8e4bc; 
    color: #2a7a4c;
    border-color: #a9d08e;
}
.badge.estado-derivado { 
    background: #ddebf7; 
    color: #2f75b5;
    border-color: #9bc2e6;
}

/* ===== BOTONES ===== */
.btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
    background: #f2f2f2;
    color: #201f1f;
    border-color: #d0d7e0;
}

.btn:hover {
    background: #e6e6e6;
    border-color: #b3b3b3;
}

.btn-primary {
    background: #2a7a4c;
    color: white;
    border-color: #1a5c36;
}

.btn-primary:hover {
    background: #1a5c36;
    border-color: #0d4726;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border-color: #5a6268;
}

.btn-secondary:hover {
    background: #5a6268;
    border-color: #484e53;
}

.btn-success { 
    background: #2a7a4c; 
    color: white; 
    border-color: #1a5c36;
}
.btn-success:hover { 
    background: #1a5c36; 
    border-color: #0d4726;
}

.btn-warning { 
    background: #ed7d31; 
    color: white; 
    border-color: #d96614;
}
.btn-warning:hover { 
    background: #d96614; 
    border-color: #c55a11;
}

.btn-danger { 
    background: #c55a11; 
    color: white; 
    border-color: #a3470e;
}
.btn-danger:hover { 
    background: #a3470e; 
    border-color: #82390b;
}

.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.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 4px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #d0d7e0;
}

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

.close:hover {
    color: #c55a11;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #d0d7e0;
    border-radius: 3px;
    font-size: 0.95rem;
    transition: border 0.2s;
    background: #ffffff;
    color: #201f1f;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a7a4c;
    box-shadow: 0 0 0 2px rgba(42, 122, 76, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.8rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid #e1e4e8;
}

/* ===== GRID PARA FORMULARIO DE CLIENTE ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
}

.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 #d0d7e0;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    border-radius: 0 0 3px 3px;
}

.autocomplete-item {
    padding: 0.7rem;
    cursor: pointer;
    border-bottom: 1px solid #e1e4e8;
    transition: background 0.2s;
    font-size: 0.9rem;
}

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

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

/* ===== CLIENTE ENCONTRADO ===== */
.cliente-encontrado {
    background: #e7f3ed;
    padding: 1.2rem;
    border-radius: 3px;
    margin-bottom: 1.2rem;
    border: 1px solid #b7d9c8;
    border-left: 4px solid #2a7a4c;
}

.cliente-encontrado h4 {
    color: #1a5c36;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* ===== 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 #e1e4e8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

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

.validacion-option.selected {
    border-color: #2a7a4c;
    background: #e7f3ed;
    box-shadow: 0 3px 8px rgba(42, 122, 76, 0.15);
}

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

.option-content h3 {
    margin: 0 0 0.5rem 0;
    color: #1a5c36;
    font-size: 1.1rem;
    font-weight: 600;
}

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

/* ===== 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: 0.8rem;
    }
    
    .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: #1a5c36;
        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 #2a7a4c;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        border-bottom: 1px solid #d0d7e0;
    }
    
    .nav-menu.active {
        display: flex;
        max-height: 300px;
    }
    
    .nav-link {
        width: 100%;
        text-align: left;
        padding: 1rem;
        border-radius: 3px;
        border: 1px solid transparent;
        font-size: 1rem;
    }
    
    .nav-link:hover {
        background: #2a7a4c;
        border-color: #3e8c5f;
    }
    
    #main-content {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .estados-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .estado-card {
        padding: 1.2rem;
    }
    
    .count {
        font-size: 1.8rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.7rem;
    }
    
    /* Responsive para modal de validación */
    .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;
    }
}

/* 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.8rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ===== 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.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #d0d7e0;
    border-top-color: #2a7a4c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

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

::-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 específicos de Excel */
.excel-like-grid {
    background: #ffffff;
    border: 1px solid #d0d7e0;
    border-radius: 3px;
    overflow: hidden;
}

.grid-header {
    background: #f2f2f2;
    font-weight: 600;
    color: #201f1f;
    border-bottom: 2px solid #d0d7e0;
}

.grid-row {
    border-bottom: 1px solid #e1e4e8;
    transition: background 0.2s;
}

.grid-row:hover {
    background: #f0f7ff;
}

.grid-cell {
    padding: 0.8rem 1rem;
    border-right: 1px solid #e1e4e8;
}

.grid-cell:last-child {
    border-right: none;
}

/* Estilos para equipos */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

.equipo-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.equipo-item:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.equipo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.equipo-header h5 {
    margin: 0;
    color: #2c3e50;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

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

/* Estilos para autocompletar */
.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.autocomplete-results div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-results div:hover {
    background: #f0f0f0;
}

.cliente-encontrado {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.cliente-encontrado h4 {
    color: #155724;
    margin-top: 0;
}

/* ===== ESTILOS PARA MODAL DE DETALLE EXCEL ===== */
.solicitud-excel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.excel-header {
    background: #1a5276;
    color: white;
    padding: 15px 20px;
    border-bottom: 3px solid #3498db;
}

.excel-title {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.logo-excel {
    background: white;
    color: #1a5276;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.excel-title h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.excel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
    font-size: 12px;
}

.meta-item {
    display: flex;
    gap: 5px;
}

.meta-label {
    font-weight: bold;
    color: #aed6f1;
}

.meta-value {
    color: white;
}

.excel-body {
    padding: 20px;
}

.excel-section {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.excel-section-title {
    background: #2e86c1;
    color: white;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 14px;
}

.excel-row {
    display: flex;
    border-bottom: 1px solid #eee;
}

.excel-row:last-child {
    border-bottom: none;
}

.excel-cell {
    padding: 8px 15px;
    border-right: 1px solid #eee;
    min-height: 35px;
    display: flex;
    align-items: center;
}

.excel-cell:last-child {
    border-right: none;
}

.excel-cell.label {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.excel-cell.value {
    font-size: 13px;
    color: #34495e;
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.excel-table th {
    background: #3498db;
    color: white;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    border: 1px solid #ddd;
}

.excel-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    font-size: 12px;
    color: #2c3e50;
}

.excel-table tr:nth-child(even) {
    background: #f8f9fa;
}

.excel-table tr:hover {
    background: #e8f4fc;
}

.excel-footer {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-top: 2px solid #ddd;
    font-size: 11px;
    color: #7f8c8d;
    line-height: 1.4;
    text-align: center;
}

/* Responsive para tabla de equipos */
@media (max-width: 768px) {
    .excel-table {
        display: block;
        overflow-x: auto;
    }
    
    .excel-row {
        flex-wrap: wrap;
    }
    
    .excel-cell {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .excel-cell.label {
        background: #e8f4fc;
    }
}