/* Como testar? — plano de teste das tarefas de sprint */

.task-complete-slot,
.task-complete-row.has-test-plan {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-complete-row.has-test-plan {
    display: flex;
    justify-content: flex-end;
}

.task-test-plan-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(14, 165, 233, 0.1);
    color: #7dd3fc;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.task-test-plan-btn:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(56, 189, 248, 0.6);
    color: #e0f2fe;
}

.task-test-plan-btn.has-steps {
    border-color: rgba(167, 139, 250, 0.45);
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.task-test-plan-btn.has-steps:hover {
    background: rgba(139, 92, 246, 0.22);
    color: #ede9fe;
}

.task-test-plan-btn.is-done {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.task-test-plan-btn.is-done:hover {
    background: rgba(34, 197, 94, 0.24);
    color: #dcfce7;
}

.task-test-plan-btn-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.task-test-plan-btn-icon svg {
    display: block;
}

.task-build-plan-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.22);
    color: #fde68a;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

/* Modal */

#task-test-plan-modal .task-test-plan-dialog.modal.modal-wide,
#task-build-plan-modal .task-test-plan-dialog.modal.modal-wide {
    width: min(820px, calc(100vw - 32px));
    max-width: min(820px, calc(100vw - 32px));
}

.task-test-plan-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.task-test-plan-heading h2 {
    margin: 0;
}

.task-test-plan-task-title {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-test-plan-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-test-plan-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.task-test-plan-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.task-test-plan-status.is-done {
    color: #86efac;
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(74, 222, 128, 0.42);
}

.task-test-plan-weight-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.task-test-plan-weight-field span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
}

.task-test-plan-weight-field input {
    width: 90px;
    text-align: center;
}

.task-test-plan-weight-hint {
    margin: -4px 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: right;
}

.task-test-plan-weight-hint:empty {
    display: none;
}

.task-test-plan-editor-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-test-plan-editor-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}

.task-test-plan-editor {
    min-height: 260px;
    max-height: min(55vh, 520px);
    overflow-y: auto;
}

.task-test-plan-editor .ql-editor {
    min-height: 240px;
    font-size: 0.95rem;
}

.task-test-plan-body > .form-feedback:empty {
    display: none;
}

.task-test-plan-footer {
    flex-wrap: wrap;
}

.task-test-plan-complete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #22c55e, #15803d);
    border-color: transparent;
}

.task-test-plan-complete-btn:hover {
    filter: brightness(1.08);
}

.task-test-plan-complete-btn.is-reopen {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.task-test-plan-complete-icon {
    display: inline-flex;
}

/* Construção */

#task-build-plan-modal .task-build-plan-dialog.modal.modal-wide {
    width: min(960px, calc(100vw - 32px));
    max-width: min(960px, calc(100vw - 32px));
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
}

.task-build-plan-description {
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.task-build-plan-description.hidden {
    display: none;
}

.task-build-plan-description > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.task-build-plan-description > summary::-webkit-details-marker {
    display: none;
}

.task-build-plan-description > summary::before {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.task-build-plan-description[open] > summary::before {
    transform: rotate(45deg);
}

.task-build-plan-description > summary:hover {
    color: #f1f5f9;
}

.task-build-plan-description-content {
    padding: 4px 16px 14px;
    font-size: 0.9rem;
    color: #e2e8f0;
    max-height: 45vh;
    overflow-y: auto;
    overflow-wrap: anywhere;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.task-build-plan-description-content img {
    max-width: 100%;
    height: auto;
}

#task-build-plan-modal .task-build-steps {
    max-height: none;
    overflow: visible;
    flex-shrink: 0;
}

#task-build-plan-modal .task-build-plan-editor-wrap {
    flex-shrink: 0;
}

.task-build-plan-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    flex: 1;
    max-width: 320px;
}

.task-build-plan-progress-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fcd34d;
}

.task-build-plan-progress.is-done .task-build-plan-progress-text {
    color: #86efac;
}

.task-build-plan-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.task-build-plan-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    transition: width 0.25s;
}

.task-build-plan-progress.is-done .task-build-plan-progress-bar span {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.task-build-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(40vh, 420px);
    overflow-y: auto;
}

.task-build-steps-empty {
    margin: 0;
    padding: 18px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    color: #94a3b8;
    font-size: 0.86rem;
    text-align: center;
}

.task-build-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.task-build-step.is-editing {
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.task-build-step.is-done {
    background: rgba(34, 197, 94, 0.07);
    border-color: rgba(74, 222, 128, 0.25);
}

.task-build-step-check {
    width: 28px;
    height: 28px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid rgba(148, 163, 184, 0.5);
    background: transparent;
    color: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.task-build-step-check:hover {
    border-color: #4ade80;
    color: rgba(74, 222, 128, 0.6);
}

.task-build-step.is-done .task-build-step-check {
    background: #22c55e;
    border-color: #22c55e;
    color: #052e16;
}

.task-build-step-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.task-build-step-number {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.task-build-step-content {
    font-size: 0.9rem;
    color: #e2e8f0;
    overflow-wrap: anywhere;
}

.task-build-step-content > :first-child {
    margin-top: 0;
}

.task-build-step-content > :last-child {
    margin-bottom: 0;
}

.task-build-step.is-done .task-build-step-content {
    color: #94a3b8;
    text-decoration: line-through;
    text-decoration-color: rgba(148, 163, 184, 0.5);
}

.task-build-step-actions {
    display: inline-flex;
    gap: 4px;
}

.task-build-step-delete:hover {
    color: #f87171;
}

.task-build-plan-editor {
    min-height: 120px;
}

.task-build-plan-editor .ql-editor {
    min-height: 110px;
    max-height: 260px;
    font-size: 0.95rem;
}

.task-build-plan-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#task-build-plan-modal.is-busy .task-build-steps {
    opacity: 0.7;
}

@media (max-width: 520px) {
    .task-test-plan-btn {
        padding: 0 8px;
        font-size: 0.72rem;
    }

    .task-test-plan-weight-hint {
        text-align: left;
    }

    .task-build-plan-progress {
        max-width: none;
    }
}
