/* ==========================================================================
   TASK CARD QUICK ACTIONS (BITRIX24-STYLE)
   Стили интерактивных микро-действий для карточек задач
   (Канбан, Мой план, Сроки, Список)
   ========================================================================== */

/* Общие стили для кликабельных бейджей */
.dt-card__action-btn {
    cursor: pointer !important;
    position: relative;
    user-select: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dt-card__action-btn:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .dt-card__action-btn:hover {
    filter: brightness(1.18);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.dt-card__action-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Стрелочка раскрытия меню (Chevron) */
.dt-action-caret {
    font-size: 9px;
    margin-left: 4px;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dt-card__action-btn:hover .dt-action-caret {
    opacity: 0.95;
    transform: translateY(1px);
}

/* Интерактивный статус */
.dt-card__status.dt-card__action-btn {
    padding: 3px 8px;
    border: 1px solid transparent;
}

.dt-card__status.dt-card__action-btn:hover {
    border-color: currentColor;
}

/* Интерактивный приоритет */
.dt-card__priority.dt-card__action-btn {
    padding: 3px 8px;
    border: 1px solid transparent;
}

.dt-card__priority.dt-card__action-btn:hover {
    border-color: currentColor;
}

.dt-priority-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Интерактивный крайний срок */
.dt-card__deadline.dt-card__action-btn:hover {
    border-color: var(--primary, #3b82f6) !important;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary, #3b82f6) !important;
}

.dt-card__deadline.dt-deadline--overdue.dt-card__action-btn:hover {
    border-color: #ef4444 !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

[data-theme="dark"] .dt-card__deadline.dt-deadline--overdue.dt-card__action-btn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

/* Блок участников и соисполнители */
.dt-card__participants.dt-card__action-btn {
    padding: 2px 4px;
    border-radius: 20px;
    transition: background-color 0.18s ease;
}

.dt-card__participants.dt-card__action-btn:hover {
    background: rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .dt-card__participants.dt-card__action-btn:hover {
    background: rgba(99, 102, 241, 0.22);
}

/* Бейдж соисполнителей на карточке */
.dt-collaborators-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
    padding: 2px 6px;
    background: var(--surface-sunken, #f1f5f9);
    color: var(--surface-text-muted, #64748b);
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    transition: all 0.18s ease;
}

.dt-card__participants:hover .dt-collaborators-badge {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
}

/* ==========================================================================
   ВСПЛЫВАЮЩИЕ МЕНЮ (FLOATING QUICK POPOVERS)
   ========================================================================== */

.b24-quick-popover {
    position: fixed;
    z-index: 1090;
    display: none;
    min-width: 190px;
    max-width: 320px;
    background: var(--surface-card, #ffffff);
    color: var(--surface-text, #0f172a);
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 6px;
    font-size: 13px;
    animation: b24PopFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .b24-quick-popover {
    background: rgba(30, 41, 59, 0.95);
    border-color: #334155;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

@keyframes b24PopFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Пункты всплывающего меню */
.b24-popover-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--surface-text, #0f172a);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

[data-theme="dark"] .b24-popover-item {
    color: #f1f5f9;
}

.b24-popover-item:hover {
    background: var(--surface-sunken, #f1f5f9);
}

[data-theme="dark"] .b24-popover-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.b24-popover-item.is-active {
    font-weight: 700;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

[data-theme="dark"] .b24-popover-item.is-active {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

.b24-popover-item .b24-check-icon {
    margin-left: auto;
    font-size: 11px;
    color: #4f46e5;
    opacity: 0;
}

[data-theme="dark"] .b24-popover-item .b24-check-icon {
    color: #818cf8;
}

.b24-popover-item.is-active .b24-check-icon {
    opacity: 1;
}

/* Маркеры статусов и иконки приоритетов в поповере */
.b24-status-dot-lg {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.b24-priority-icon-wrap {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ==========================================================================
   ПОПОВЕР ДЕДЛАЙНА (DEADLINE PICKER)
   ========================================================================== */

.b24-deadline-popover {
    min-width: 260px;
    max-width: 290px;
    padding: 10px;
}

.b24-deadline-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--surface-text-muted, #64748b);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.b24-deadline-presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
}

.b24-deadline-preset-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--surface-border, #e2e8f0);
    background: var(--surface-sunken, #f8fafc);
    color: var(--surface-text, #1e293b);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s ease;
}

[data-theme="dark"] .b24-deadline-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
    color: #e2e8f0;
}

.b24-deadline-preset-btn:hover {
    background: var(--primary, #3b82f6);
    color: #ffffff;
    border-color: var(--primary, #3b82f6);
}

.b24-deadline-preset-btn--full {
    grid-column: span 2;
}

.b24-deadline-divider {
    height: 1px;
    background: var(--surface-border, #e2e8f0);
    margin: 8px 0;
}

[data-theme="dark"] .b24-deadline-divider {
    background: #334155;
}

.b24-deadline-custom-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО УЧАСТНИКОВ И ДЕЛЕГИРОВАНИЯ (TASK PARTICIPANTS MODAL)
   ========================================================================== */

.b24-part-section {
    background: var(--surface-sunken, #f8fafc);
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

[data-theme="dark"] .b24-part-section {
    background: rgba(255, 255, 255, 0.03);
    border-color: #334155;
}

.b24-part-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--surface-text-muted, #64748b);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.b24-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--surface-card, #ffffff);
    border: 1px solid var(--surface-border, #e2e8f0);
}

[data-theme="dark"] .b24-user-card {
    background: rgba(30, 41, 59, 0.7);
    border-color: #334155;
}

.b24-user-avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.b24-user-avatar-wrap img,
.b24-user-avatar-wrap .b24-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.b24-collab-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: var(--surface-card, #ffffff);
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .b24-collab-chip {
    background: rgba(30, 41, 59, 0.8);
    border-color: #334155;
}

.b24-collab-chip-remove {
    border: none;
    background: transparent;
    color: var(--surface-text-muted, #94a3b8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.b24-collab-chip-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Список кандидатов для выбора */
.b24-candidate-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.12s ease;
    border-bottom: 1px solid var(--surface-border, #f1f5f9);
}

[data-theme="dark"] .b24-candidate-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.b24-candidate-item:hover {
    background: var(--surface-sunken, #f1f5f9);
}

[data-theme="dark"] .b24-candidate-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.b24-candidate-item.is-selected {
    background: rgba(99, 102, 241, 0.12);
}

.b24-candidate-list {
    max-height: 220px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--surface-border, #e2e8f0);
}

[data-theme="dark"] .b24-candidate-list {
    border-color: #334155;
}

/* Оверлей фона для закрытия поповера по клику вне */
.b24-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: transparent;
    display: none;
}
