.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.employee-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.employee-basic {
    display: flex;
    align-items: center;
    gap: 15px;
}

.employee-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.employee-details h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #2d3748;
}

.employee-meta {
    display: flex;
    gap: 15px;
    color: #718096;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.summary-stats {
    display: flex;
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    min-width: 100px;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
}

.evaluation-tabs {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tab-header {
    display: flex;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 15px 15px 0 0;
}

.tab-button {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #718096;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    font-size: 0.9rem;
}

.tab-button.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.tab-badge {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.tab-button.active .tab-badge {
    background: #667eea;
    color: white;
}

.tab-content {
    padding: 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3748;
}

.progress-summary {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
    color: #718096;
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.controls-section {
    /* background: #f8f9fa; */
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    min-width: 200px;
    flex: 1;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
}

.objectives-container {
    display: flex;
    /* flex-direction: column; */
    gap: 20px;
}

.objective-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.objective-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.objective-main {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.objective-main:hover {
    /* background-color: #fafbfc; */
}

.objective-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px;
}

.objective-info {
    flex: 1;
}

.objective-number {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.objective-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #2d3748;
    line-height: 1.3;
}

.objective-meta {
    font-size: 0.75rem;
    color: #718096;
    line-height: 1.4;
}

.objective-actions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-shrink: 0;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: #718096;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.expand-icon:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.objective-card.expanded .expand-icon {
    transform: rotate(180deg);
}

.objective-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-completed {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
}

.status-partial {
    background: rgba(237, 137, 54, 0.1);
    color: #dd6b20;
}

.status-pending {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
}

.status-high-performance {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.4);
    }

    to {
        box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
    }
}

.performance-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.objective-score {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.objective-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.metric {
    text-align: center;
    padding: 10px;
    background: #f7fafc;
    border-radius: 8px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 2px;
}

.metric-label {
    font-size: 0.7rem;
    color: #718096;
}

.objective-evaluation {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.score-input {
    width: 70px;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.score-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sub-objectives {
    padding: 15px 20px;
    background: #fafbfc;
    display: none;
    transition: all 0.3s ease;
}

.objective-card.expanded .sub-objectives {
    display: block;
}

.sub-objectives-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-objective {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.sub-objective:last-child {
    margin-bottom: 0;
}

.sub-objective-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.sub-objective-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    flex: 1;
}

.sub-objective-evaluation {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.competencies-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.competency-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.competency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.competency-name {
    font-weight: 700;
    color: #2d3748;
    font-size: 0.95rem;
}

.competency-type {
    font-size: 0.75rem;
    color: #718096;
    background: #f7fafc;
    padding: 4px 8px;
    border-radius: 12px;
}

.competency-description {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 15px;
    line-height: 1.4;
}

.rating-scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}

.rating-option {
    padding: 8px 4px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.rating-option:hover {
    border-color: #667eea;
}

.rating-option.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.competency-scores {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #718096;
    gap: 10px;
    flex-wrap: wrap;
}

.comments-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.comment-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.comment-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-title {
    font-weight: 700;
    color: #2d3748;
}

.comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.comment-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-size: 0.8rem;
}

.toast.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 10px;
    }

    .objective-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .rating-scale {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .employee-info {
        flex-direction: column;
        text-align: center;
    }

    .employee-basic {
        flex-direction: column;
        text-align: center;
    }

    .summary-stats {
        justify-content: center;
    }

    .tab-header {
        flex-direction: column;
    }

    .tab-button {
        border-radius: 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: auto;
    }

    .objective-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .objective-actions {
        align-self: flex-end;
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .performance-badge {
        order: -1;
        align-self: flex-start;
        margin-bottom: 8px;
    }

    .objective-evaluation {
        flex-direction: column;
        align-items: stretch;
    }

    .sub-objective-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sub-objective-evaluation {
        align-self: flex-end;
        width: 100%;
        justify-content: space-between;
    }

    .rating-scale {
        grid-template-columns: repeat(2, 1fr);
    }

    .competency-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .competency-scores {
        flex-direction: column;
        align-items: flex-start;
    }

    .comments-section {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .objective-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .employee-details h1 {
        font-size: 1.2rem;
    }

    .employee-meta {
        flex-direction: column;
        gap: 5px;
    }

    .stat-card {
        min-width: 80px;
        padding: 8px 12px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .objective-metrics {
        grid-template-columns: 1fr;
    }

    .rating-scale {
        grid-template-columns: 1fr;
    }

    .rating-option {
        padding: 12px;
    }
}

.foto-perfil-bg {
    width: 60px;
    height: 60px;
    /* o un valor fijo si lo necesitas */
    aspect-ratio: 1 / 1;
    /* mantiene forma cuadrada */
    border-radius: 50%;
    /* para hacerlo circular */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Container principal */
#objetivos-container {
    max-width: 100%;
    padding: 20px;
}

/* Loading state */
.loading-objectives {
    text-align: center;
    padding: 40px 20px;
}

.loading-objectives .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* No objectives state */
.no-objectives {
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* Tarjeta de objetivo */
.objective-card {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.objective-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Header del objetivo */
.objective-main {
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.objective-main:hover {
    /* background-color: #f8f9fa; */
}

.objective-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

/* Número del objetivo */
.objective-number {
    background: #4e73df;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.objective-number.status-completed {
    /* background: #1cc88a; */
    background: rgb(47, 67, 250);
}

.objective-number.status-partial {
    /* background: #f6c23e; */
    background: rgb(47, 67, 250);
}

.objective-number.status-pending {
    /* background: #858796; */
    background: rgb(47, 67, 250);
}

/* Información del objetivo */
.objective-info {
    flex: 1;
    min-width: 0;
}

.objective-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.objective-status {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
}

.objective-status.status-completed {
    color: #1cc88a;
}

.objective-status.status-partial {
    color: #f6c23e;
}

.objective-status.status-pending {
    color: #858796;
}

.objective-meta {
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

/* Acciones */
.objective-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.action-btn {
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.action-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.expand-icon {
    color: #858796;
    transition: transform 0.3s ease;
    font-size: 16px;
}

/* Métricas del objetivo */
.objective-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e3e6f0;
}

.metric {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.metric-label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Barra de progreso */
.objective-progress {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e3e6f0;
}

.progress-bar-container {
    background: #e3e6f0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4e73df, #1cc88a);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 12px;
    color: #718096;
    text-align: center;
    display: block;
}

/* Sub-objetivos */
.sub-objectives {
    background: #f8f9fa;
    padding: 20px;
    border-top: 1px solid #e3e6f0;
    display: none;
}

.sub-objectives-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    color: #4e73df;
    font-size: 16px;
}

.sub-objective {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.sub-objective:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sub-objective:last-child {
    margin-bottom: 0;
}

.sub-objective-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sub-objective-name {
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

/* Estados de resultado */
.text-success {
    color: #1cc88a !important;
    font-weight: 600;
}

.text-warning {
    color: #f6c23e !important;
    font-weight: 600;
}

.text-danger {
    color: #e74a3b !important;
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    .objective-header {
        flex-direction: column;
        gap: 12px;
    }

    .objective-actions {
        align-self: flex-end;
    }

    .objective-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .objective-title {
        font-size: 16px;
    }

    .sub-objective-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    #objetivos-container {
        padding: 10px;
    }

    .objective-main {
        padding: 16px;
    }

    .objective-metrics {
        grid-template-columns: 1fr;
    }

    .sub-objectives {
        padding: 16px;
    }

    .sub-objective {
        padding: 12px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.objective-card {
    animation: fadeIn 0.3s ease forwards;
}

/* Estados de la tarjeta según datos */
.objective-card[data-status="completed"] {
    border-left: 4px solid #1cc88a;
}

.objective-card[data-status="partial"] {
    border-left: 4px solid #f6c23e;
}

.objective-card[data-status="pending"] {
    border-left: 4px solid #858796;
}

/* Efectos hover mejorados */
.objective-card:hover .objective-number {
    transform: scale(1.1);
}

/* Scrollbar personalizado para containers largos */
#objetivos-container::-webkit-scrollbar {
    width: 6px;
}

#objetivos-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

#objetivos-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

#objetivos-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* ===========================================
            ESTILOS PARA DRAG & DROP DE OBJETIVOS
            =========================================== */

/* Estilos base para elementos arrastrables */
.objective-card[draggable="true"],
.sub-objective[draggable="true"] {
    cursor: move;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Handle de arrastre para objetivos principales */
.objective-number {
    position: relative;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.objective-number:hover {
    /* background: linear-gradient(135deg, #5a67d8, #6b46c1); */
    transform: scale(1.1);
    /* box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4); */
}

.objective-number:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Handle de arrastre para sub-objetivos */
.drag-handle {
    color: #999;
    font-size: 12px;
    padding: 6px 4px;
    border-radius: 4px;
    cursor: grab;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.sub-objective:hover .drag-handle {
    opacity: 1;
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Estados durante el arrastre */
.objective-card.dragging,
.sub-objective.dragging {
    opacity: 0.6;
    transform: scale(0.98) rotate(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px dashed #667eea;
    background-color: rgba(102, 126, 234, 0.05);
}

/* Zonas de drop válidas */
.drag-valid-zone {
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    background-color: rgba(102, 126, 234, 0.02) !important;
    position: relative;
}

.drag-valid-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1)) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Estado de hover durante drag */
.drag-over {
    border: 2px solid #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08)) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.2) !important;
}

.drag-over::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: inherit;
    z-index: -1;
    animation: dragGlow 1s ease-in-out infinite alternate;
}

@keyframes dragGlow {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.8;
    }
}

/* Indicadores de posición de drop */
.drop-indicator {
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 8px 0;
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.drop-indicator.active {
    opacity: 1;
    transform: scaleX(1);
}

.drop-indicator.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: dropShine 1.5s ease-in-out infinite;
}

@keyframes dropShine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Controles de drag & drop */
.drag-drop-controls {
    background: linear-gradient(135deg, #f8f9fc, #e9ecf7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.drag-drop-controls .btn {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.drag-drop-controls .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.drag-drop-controls .btn:hover::before {
    left: 100%;
}

.drag-drop-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Feedback visual para diferentes tipos de objetivos */
.objective-card[data-status="completed"] .objective-number {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.objective-card[data-status="partial"] .objective-number {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.objective-card[data-status="pending"] .objective-number {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    /* color: #4a5568; */
}

/* Animaciones suaves para reordenamiento */
.objective-card,
.sub-objective {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estados de carga durante guardado */
.saving-order {
    position: relative;
    pointer-events: none;
}

.saving-order::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* Tooltips para drag handles */
.objective-number[title]:hover::after,
.drag-handle[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.objective-number[title]:hover::before,
.drag-handle[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .objective-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .drag-handle {
        font-size: 10px;
        padding: 4px 2px;
    }

    .drag-drop-controls {
        padding: 12px;
    }

    .drag-drop-controls .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Mejoras de accesibilidad */
.objective-card:focus,
.sub-objective:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animación de éxito al guardar orden */
@keyframes orderSaved {
    0% {
        background-color: rgba(72, 187, 120, 0.1);
        border-color: #48bb78;
    }

    100% {
        background-color: transparent;
        border-color: #e2e8f0;
    }
}

.order-saved {
    animation: orderSaved 1s ease-out;
}

/* Preloader para drag preview */
.drag-preview {
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: rotate(5deg) scale(0.9);
    opacity: 0.9;
    pointer-events: none;
    z-index: 1000;
}

/* Ghost element durante drag */
.drag-ghost {
    opacity: 0.4 !important;
    transform: scale(0.95) !important;
    filter: grayscale(50%);
}

.drag-over {
    border: 2px dashed #667eea !important;
    background-color: rgba(102, 126, 234, 0.05) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15) !important;
}

.drag-valid-zone {
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    background-color: rgba(102, 126, 234, 0.02) !important;
}

.objective-card[draggable="true"]:hover .objective-number {
    background: linear-gradient(135deg, #5a67d8, #6b46c1) !important;
    transform: scale(1.05) !important;
}

.drag-handle:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
}

.objective-card.dragging,
.sub-objective.dragging {
    opacity: 0.5 !important;
    transform: scale(0.95) !important;
    border: 2px dashed #667eea !important;
    background-color: rgba(102, 126, 234, 0.05) !important;
}

.sub-objective[draggable="true"]:hover {
    background-color: rgba(102, 126, 234, 0.02);
    border-left: 3px solid #667eea;
}

/* Transiciones suaves */
.objective-card,
.sub-objective {
    transition: all 0.2s ease;
}

.objective-number {
    transition: all 0.2s ease;
}

/* Cursor personalizado durante arrastre */
.objective-card[draggable="true"] .objective-number {
    cursor: grab;
}

.objective-card[draggable="true"] .objective-number:active {
    cursor: grabbing;
}

/* Estados de guardado */
.saving-order {
    position: relative;
    pointer-events: none;
}

.saving-order::after {
    content: '⏳ Guardando...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #667eea;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.order-saved {
    animation: orderSaved 1s ease-out;
}

@keyframes orderSaved {
    0% {
        background-color: rgba(72, 187, 120, 0.1);
        border-color: #48bb78;
    }

    100% {
        background-color: transparent;
        border-color: #e2e8f0;
    }
}

/* Auto-scroll zones visualization */
.auto-scroll-zone {
    position: fixed;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(102, 126, 234, 0.1), transparent);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auto-scroll-zone.top {
    top: 0;
}

.auto-scroll-zone.bottom {
    bottom: 0;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.1), transparent);
}

.auto-scroll-zone.active {
    opacity: 1;
}

/* ESTILOS MODIFICADOS PARA BÚSQUEDA */
.search-highlight {
    position: relative;
    border: 2px solid #007bff !important;
    background-color: rgba(0, 123, 255, 0.1) !important;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3) !important;
}

.search-found {
    animation: searchBlink 2s infinite !important;
}

/* NUEVA ANIMACIÓN: Parpadeo activo por 1.5 segundos exactos */
.search-blink-active {
    animation: searchFoundBlinkActive 0.75s ease-in-out 2 !important;
}

@keyframes searchBlink {

    0%,
    50%,
    100% {
        border-color: #007bff;
    }

    25%,
    75% {
        border-color: #00d4ff;
    }
}

@keyframes searchFoundBlinkActive {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
        transform: scale(1);
        border-color: #007bff;
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 123, 255, 0.6);
        transform: scale(1.02);
        border-color: #00d4ff;
    }
}

/* ESTILOS PARA EDICIÓN RÁPIDA */
.editable-metric {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.editable-metric:hover {
    border-radius: 6px;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.editable-metric:hover::after {
    content: '✎';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    color: #667eea;
    opacity: 0.7;
}

/* ESTILOS PARA MÉTRICAS NO EDITABLES */
.non-editable-metric {
    cursor: not-allowed;
    position: relative;
    transition: all 0.2s ease;
}

.non-editable-metric:hover {
    background-color: rgba(220, 53, 69, 0.05);
    border-radius: 6px;
}

.non-editable-metric:hover::after {
    content: '🔒';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    color: #dc3545;
    opacity: 0.7;
}

.editing-field {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border: 1px solid #ffc107 !important;
    border-radius: 6px;
    animation: editingPulse 0.5s ease-in-out;
}

@keyframes editingPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* Parpadeo azul por 1.5 segundos para campos del modal */
.field-highlighted {
    background-color: rgba(0, 123, 255, 0.1) !important;
    border: 2px solid #007bff !important;
    border-radius: 4px;
    animation: fieldHighlightBlue 0.75s ease-in-out 2;
}

@keyframes fieldHighlightBlue {

    0%,
    100% {
        background-color: rgba(0, 123, 255, 0.1);
        box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
        border-color: #007bff;
    }

    50% {
        background-color: rgba(0, 123, 255, 0.2);
        box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
        border-color: #0056b3;
    }
}

/* ESTILOS PARA COPIAR TEXTO */
.objective-title {
    cursor: pointer;
    transition: all 0.2s ease;
}

.objective-title:hover {
    background-color: rgba(102, 126, 234, 0.05);
    border-radius: 4px;
    padding: 2px 4px;
}

.text-copied {
    animation: textCopiedFlash 1s ease-in-out;
}

@keyframes textCopiedFlash {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(40, 167, 69, 0.2);
        border-radius: 4px;
    }
}

/* ANIMACIONES PARA MENSAJES */
@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    10%,
    90% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.search-results-message {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media screen and (max-width: 767px) {
    #view-toggle-icons {
        display: none !important;
    }
}

/* ===================================================
   SOLUCIÓN PARA ÚLTIMO ELEMENTO IMPAR EN VISTA COMPACTA
   =================================================== */

/* Para el contenedor principal de objetivos */
#objetivos-container.vista-compacta .objective-card:last-child:nth-child(odd) {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Para el contenedor de objetivos sugeridos */
#objetivos-container-sugeridos.vista-compacta .objective-card:last-child:nth-child(odd) {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* Alternativa: Si quieres que el último elemento impar mantenga el mismo tamaño 
   pero se centre en lugar de ocupar todo el ancho, usa esto en su lugar: */

/*
#objetivos-container.vista-compacta .objective-card:last-child:nth-child(odd) {
    margin: 0 auto !important;
    width: calc(50% - 10px) !important;
    flex: 0 0 calc(50% - 10px) !important;
}

#objetivos-container-sugeridos.vista-compacta .objective-card:last-child:nth-child(odd) {
    margin: 0 auto !important;
    width: calc(50% - 10px) !important;
    flex: 0 0 calc(50% - 10px) !important;
}
*/

/* ===================================================
   ESTILOS ADICIONALES PARA MEJORAR LA EXPERIENCIA
   =================================================== */

/* Transición suave para cambios de tamaño */
#objetivos-container.vista-compacta .objective-card,
#objetivos-container-sugeridos.vista-compacta .objective-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Asegurar que el contenedor flex se comporte correctamente */
#objetivos-container.vista-compacta,
#objetivos-container-sugeridos.vista-compacta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: stretch !important;
}

/* Mejorar el comportamiento responsive */
@media (max-width: 768px) {
    /* En móviles, todos los elementos ocupan el ancho completo */
    #objetivos-container.vista-compacta .objective-card,
    #objetivos-container-sugeridos.vista-compacta .objective-card {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ===================================================
   VARIANTE: GRILLA CSS (ALTERNATIVA MÁS MODERNA)
   =================================================== */

/* Si prefieres usar CSS Grid en lugar de Flexbox para un mejor control: */

/*
#objetivos-container.vista-compacta,
#objetivos-container-sugeridos.vista-compacta {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(calc(50% - 10px), 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
}

#objetivos-container.vista-compacta .objective-card,
#objetivos-container-sugeridos.vista-compacta .objective-card {
    width: 100% !important;
    flex: none !important;
    margin-bottom: 0 !important;
}
*/