/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
    padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title { font-size: 1.1rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
}

.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Dropdown */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 150;
    padding: 4px 0;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: .875rem;
    color: var(--gray-700);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover { background: var(--gray-50); color: var(--gray-900); }
.dropdown-item--danger { color: var(--danger); }
.dropdown-item--danger:hover { background: #FEF2F2; }

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: .75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    margin-bottom: 4px;
}

[data-tooltip]:hover::after { opacity: 1; }

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

.spinner--lg { width: 40px; height: 40px; border-width: 3px; }

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

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
    transition: width .3s ease;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    color: #fff;
    font-size: .875rem;
    box-shadow: var(--shadow-md);
    animation: slideIn .3s ease;
    max-width: 360px;
}

.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--warning { background: var(--warning); }
.toast--info { background: var(--info); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state with icon */
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: .3;
}

/* Kanban cards improvements */
.pipeline-card-assigned {
    font-size: .75rem;
    color: var(--gray-400);
    margin-top: 6px;
}

/* Activity detail */
.activity-item-detail {
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gray-300);
}

.activity-item-detail .meta {
    font-size: .8rem;
    color: var(--gray-500);
    margin-top: 8px;
}

/* User avatar in topbar */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}

/* Stats detail */
.stat-detail {
    font-size: .75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
