/**
 * Pipeline Kanban Styles - Estilo Kommo
 */

/* Pipeline Header */
.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pipeline-header-left h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.pipeline-summary {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pipeline-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pipeline-search {
    position: relative;
    display: flex;
    align-items: center;
}

.pipeline-search-input {
    padding: 10px 40px 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.2s;
}

.pipeline-search-input:focus {
    outline: none;
    border-color: #2196F3;
}

.pipeline-search i {
    position: absolute;
    right: 12px;
    color: #999;
    pointer-events: none;
}

/* Pipeline Container */
.pipeline-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    min-height: 600px;
}

.pipeline-column {
    flex: 1;
    min-width: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 4px solid;
    padding: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
}

.pipeline-column-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.pipeline-column-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pipeline-column-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.pipeline-count {
    background: #e0e0e0;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pipeline-column-value {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pipeline-cards {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.pipeline-cards.drag-over {
    background: #e3f2fd;
    border: 2px dashed #2196F3;
    border-radius: 4px;
}

/* Pipeline Card */
.pipeline-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.pipeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pipeline-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.pipeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pipeline-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.pipeline-card-priority {
    font-size: 10px;
    opacity: 0.7;
}

.pipeline-card-priority.priority-low {
    color: #4CAF50;
}

.pipeline-card-priority.priority-normal {
    color: #2196F3;
}

.pipeline-card-priority.priority-high {
    color: #FF9800;
}

.pipeline-card-priority.priority-urgent {
    color: #F44336;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.pipeline-card-body {
    margin-bottom: 8px;
}

.pipeline-card-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.pipeline-card-description {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pipeline-card-value {
    font-size: 14px;
    font-weight: 600;
    color: #4CAF50;
    margin-top: 8px;
}

.pipeline-card-value i {
    margin-right: 4px;
}

.pipeline-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.pipeline-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

.pipeline-card-due {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: inline-block;
}

.pipeline-card-due.overdue {
    background: #ffebee;
    color: #c62828;
}

.pipeline-card-due.today {
    background: #fff3e0;
    color: #e65100;
}

.pipeline-card-due.soon {
    background: #fff9c4;
    color: #f57f17;
}

.pipeline-card-due.normal {
    background: #f5f5f5;
    color: #666;
}

.pipeline-card-due i {
    margin-right: 4px;
}

.pipeline-card-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.pipeline-card-action {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 12px;
}

.pipeline-card-action:hover {
    background: #f5f5f5;
    color: #2196F3;
}

/* Scrollbar personalizado */
.pipeline-cards::-webkit-scrollbar {
    width: 6px;
}

.pipeline-cards::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.pipeline-cards::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.pipeline-cards::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 1200px) {
    .pipeline-container {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .pipeline-column {
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .pipeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .pipeline-header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .pipeline-search-input {
        width: 100%;
    }
    
    .pipeline-column {
        min-width: 250px;
    }
}

/* Tabs para configuración de BD externa */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--text-color-secondary);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: var(--hover-bg-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

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

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

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

