.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex !important;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: var(--glass-border);
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.detail-modal-content {
    max-width: 1560px;
    width: 96vw;
    min-width: 760px;
    height: 85vh;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-main);
}

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

.detail-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-check-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: transparent;
}

.detail-check-btn:hover {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.detail-check-btn.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.detail-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-action-btn:hover {
    background: var(--bg-card);
    color: var(--text-main);
}

.detail-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.detail-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.detail-info {
    width: 380px;
    padding: 24px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.detail-title {
    width: 100%;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.4;
    font-family: inherit;
}

.detail-title::placeholder {
    color: var(--text-muted);
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-chip {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-chip:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

.date-chip.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.date-chip--custom.has-date {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.date-chip--clear:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.detail-desc-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.detail-desc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-desc {
    width: 100%;
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
}

.detail-desc::placeholder {
    color: var(--text-muted);
}

.detail-subtasks {
    flex: 1;
    padding: 20px;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-subtasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.detail-subtasks-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.detail-subtasks-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.detail-kanban {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow-x: auto;
    padding-bottom: 8px;
    overscroll-behavior-x: contain;
}

.detail-column {
    flex: 1 1 320px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.detail-column-dot--todo {
    background: #f59e0b;
}

.detail-column-dot--progress {
    background: #3b82f6;
}

.detail-column-dot--done {
    background: #10b981;
}

.detail-column-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

.detail-column-items {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    min-height: 80px;
}

.detail-kanban-item {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: grab;
    transition: all 0.15s ease;
}

.detail-kanban-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.detail-kanban-item.completed .detail-kanban-item-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.detail-kanban-item-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
    outline: none;
    word-break: break-word;
}

.detail-kanban-item-delete {
    opacity: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.15s;
}

.detail-kanban-item:hover .detail-kanban-item-delete {
    opacity: 1;
}

.detail-kanban-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.detail-column-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-main);
    background: transparent;
    border: none;
    border-top: 1px solid var(--border);
    outline: none;
    font-family: inherit;
}

.detail-column-input::placeholder {
    color: var(--text-muted);
}

.detail-column-input:focus {
    background: var(--primary-bg);
}

.sortable-ghost-kanban {
    opacity: 0.4;
    background: var(--primary-bg) !important;
    border: 2px dashed var(--primary) !important;
}

.modal-content.is-expanded {
    max-width: 98vw !important;
    max-height: 98vh !important;
    width: 98vw !important;
    height: 98vh !important;
}

@media (max-width: 850px) {
    .detail-modal-content {
        min-width: auto;
        width: 95vw;
        max-width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .detail-body {
        flex-direction: column;
    }

    .detail-info {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 40vh;
    }

    .detail-kanban {
        flex-direction: column;
        overflow-y: auto;
    }

    .detail-column {
        min-width: 100%;
        width: 100%;
        flex: 0 0 auto;
        margin-bottom: 16px;
    }
}
