/* ==========================================
   PST EXTRACTOR - ESTILOS
   Hugo Morales & Asociados S.A.S.
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.6;
}

/* ==========================================
   HEADER
   ========================================== */
.modulo-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    font-size: 1.3rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-volver, .btn-logout {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-volver:hover {
    background: rgba(255,255,255,0.1);
}

.btn-logout {
    background: rgba(255,255,255,0.1);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.pst-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==========================================
   SELECTOR DE CLIENTE
   ========================================== */
.pst-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.cliente-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cliente-selector label {
    font-weight: 600;
    color: #1a1a2e;
}

.cliente-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.cliente-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.cliente-search-input:focus {
    outline: none;
    border-color: #4361ee;
}

.cliente-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.cliente-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cliente-search-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.cliente-search-item:hover {
    background: #f5f7fa;
}

.cliente-nombre {
    font-weight: 500;
    color: #1a1a2e;
}

.cliente-nit {
    color: #666;
    font-size: 0.85rem;
}

/* ==========================================
   ALERTAS
   ========================================== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.alert-info {
    background: #e7f3ff;
    color: #0056b3;
    border: 1px solid #b8daff;
}

.alert .icon {
    font-size: 1.3rem;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* ==========================================
   UPLOAD BOX
   ========================================== */
.upload-box {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-box:hover, .upload-box.dragover {
    border-color: #4361ee;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-box h3 {
    color: #1a1a2e;
    margin-bottom: 5px;
}

.upload-box p {
    color: #666;
    font-size: 0.9rem;
}

.file-info {
    margin-top: 15px;
    padding: 10px 15px;
    background: #e7f3ff;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

#fileName {
    font-weight: 600;
    color: #0056b3;
}

#fileSize {
    color: #666;
}

/* ==========================================
   FILTRO DE FECHAS
   ========================================== */
.date-filter {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.date-filter h4 {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #1a1a2e;
}

.date-inputs {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.date-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-field label {
    font-weight: 500;
    color: #666;
}

.date-field input[type="date"] {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.date-field input[type="date"]:focus {
    outline: none;
    border-color: #4361ee;
}

.date-hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #888;
}

/* ==========================================
   BOTONES
   ========================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #1a1a2e;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================
   BARRA DE PROGRESO
   ========================================== */
.progress-bar {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4361ee 0%, #7209b7 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #4361ee;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* ==========================================
   TABLAS
   ========================================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.pending {
    background: #fff3cd;
    color: #856404;
}

/* ==========================================
   FILTROS
   ========================================== */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filters input[type="text"],
.filters select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.filters input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: #4361ee;
}

/* ==========================================
   RESULTS ACTIONS
   ========================================== */
.results-actions {
    display: flex;
    gap: 10px;
}

/* ==========================================
   MODAL
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #000;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .modulo-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .header-left, .header-right {
        width: 100%;
        justify-content: center;
    }

    .cliente-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .cliente-search-wrapper {
        max-width: none;
    }

    .date-inputs {
        flex-direction: column;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .results-actions {
        width: 100%;
        justify-content: stretch;
    }

    .results-actions .btn {
        flex: 1;
    }
}
