/* Estilos para el historial de Gmail */

.status-badge {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 20px;
}

.status-processed {
    background-color: #d4edda;
    color: #155724;
}

.status-reviewed {
    background-color: #cce5ff;
    color: #004085;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.invoice-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.invoice-row:hover {
    background-color: #f8f9fa;
}

.invoice-row.row-selected {
    background-color: #e7f3ff;
    border-left: 3px solid #007bff;
}

.detail-row {
    background-color: #f8f9fa;
}

.detail-row td {
    padding: 0 !important;
    overflow: hidden;
}

.detail-panel-inline {
    border-left: 4px solid #007bff;
    background-color: #ffffff;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 1s ease-in-out;
}

.detail-panel-inline.open {
    max-height: 2000px;
    opacity: 1;
    padding: 20px;
    margin: 10px 0;
    position: relative;
}

.close-detail-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-detail-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #dc3545;
    transform: rotate(90deg);
}

.erp-sent {
    color: #28a745;
    font-weight: bold;
}

.sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: #007bff;
    color: white;
    border-radius: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.field-editable {
    background-color: #fff;
    border: 1px solid #dee2e6;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: text;
}

.field-editable:hover {
    border-color: #80bdff;
}

.last-sync {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Popup de sincronización */
.sync-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.sync-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

.sync-popup-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
}

.sync-popup-title {
    margin: 0 0 10px 0;
    color: #212529;
    font-weight: 600;
    text-align: center;
}

.sync-popup-subtitle {
    color: #6c757d;
    margin: 0 0 20px 0;
    text-align: center;
}

.sync-popup-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.sync-popup-stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.sync-popup-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #667eea;
}

.sync-popup-stat-value.error {
    color: #dc3545;
}

.sync-popup-stat-value.success {
    color: #28a745;
}

.sync-popup-stat-label {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.sync-popup-invoices {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.sync-popup-invoices-title {
    font-weight: 500;
    margin-bottom: 10px;
    color: #495057;
}

.sync-popup-invoices-list {
    margin: 0;
    padding-left: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.sync-popup-invoices-list li {
    margin-bottom: 5px;
    color: #6c757d;
    font-size: 14px;
}

.sync-popup-button {
    margin-top: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    width: 100%;
}

.sync-popup-button:hover {
    transform: translateY(-2px);
}

/* Error popup */
.sync-popup-error .sync-popup-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
