/* ========================================================================== 
   Simple Project Management
   Task management
   ========================================================================== */

.task-page {
    display: grid;
    gap: 1.4rem;
}

.task-list-card {
    min-width: 0;
}

.task-list-header {
    align-items: center;
}

.task-table-wrapper {
    overflow-x: auto;
}

.task-table {
    margin: 0;
    min-width: 1080px;
}

.task-table > :not(caption) > * > * {
    border-color: #edf1f4;
    padding: 0.85rem 0.9rem;
}

.task-table thead th {
    background: #f8fafc;
    color: #52606c;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.task-table tbody td {
    color: #374151;
    font-size: 0.82rem;
    vertical-align: middle;
}

.task-table tbody tr:hover td {
    background: #fafcfd;
}

.task-title-cell {
    min-width: 260px;
}

.task-title-cell strong,
.task-title-cell span {
    display: block;
}

.task-title-cell strong {
    color: var(--app-text);
    font-size: 0.86rem;
}

.task-title-cell span {
    color: var(--app-text-muted);
    font-size: 0.72rem;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.task-status-pill {
    background: #e0f2fe;
    border-radius: 999px;
    color: #075985;
    display: inline-flex;
    font-size: 0.67rem;
    font-weight: 800;
    padding: 0.38rem 0.55rem;
    white-space: nowrap;
}

.task-status-pill.is-complete {
    background: #dcfce7;
    color: #166534;
}

.task-effort {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.task-effort small {
    color: var(--app-text-muted);
    font-size: 0.68rem;
}

.priority-marker {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
}

.priority-10 {
    background: #f1f5f9;
    color: #475569;
}

.priority-20 {
    background: #e0f2fe;
    color: #075985;
}

.priority-30 {
    background: #fef3c7;
    color: #92400e;
}

.priority-40 {
    background: #fee2e2;
    color: #991b1b;
}

.task-form-card {
    overflow: visible;
}

.task-form-section {
    border-bottom: 1px solid var(--app-border);
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
}

.task-form-section:last-of-type {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.task-form-section-header {
    margin-bottom: 1rem;
}

.task-form-section-header h2 {
    font-size: 1.02rem;
    font-weight: 750;
    margin: 0;
}

.task-form-card .form-grid,
.task-form-card .form-field {
    overflow: visible;
}

.task-form-card .form-field:focus-within {
    z-index: 30;
}

.task-form-card .bootstrap-datetimepicker-widget,
.task-form-card .bootstrap-datetimepicker-widget.dropdown-menu,
.task-form-card .tempus-dominus-widget {
    z-index: 2100 !important;
}

.task-delete-card {
    overflow: visible;
}

/* Project detail task actions --------------------------------------------- */
.project-task-record-link {
    color: inherit;
    display: contents;
    text-decoration: none;
}

.project-task-actions {
    align-items: center;
    display: flex;
    gap: 0.35rem;
}

@media (max-width: 767.98px) {
    .task-table {
        min-width: 0;
    }

    .task-table,
    .task-table tbody,
    .task-table tr,
    .task-table td {
        display: block;
        width: 100%;
    }

    .task-table thead {
        display: none;
    }

    .task-table tbody {
        display: grid;
        gap: 0.85rem;
        padding: 0.85rem;
    }

    .task-table tbody tr {
        background: #ffffff;
        border: 1px solid var(--app-border);
        border-radius: 12px;
        box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
        overflow: hidden;
    }

    .task-table tbody td {
        align-items: start;
        border: 0;
        border-bottom: 1px solid #edf1f4;
        display: grid;
        gap: 0.55rem;
        grid-template-columns: 105px minmax(0, 1fr);
        padding: 0.7rem 0.8rem;
    }

    .task-table tbody td:last-child {
        border-bottom: 0;
    }

    .task-table tbody td::before {
        color: var(--app-text-muted);
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .task-title-cell {
        min-width: 0;
    }

    .task-table .table-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .task-table tbody td {
        display: block;
    }

    .task-table tbody td::before {
        display: block;
        margin-bottom: 0.35rem;
    }

    .task-table .table-actions {
        flex-direction: column;
    }

    .task-table .table-actions .btn {
        width: 100%;
    }
}

/* Project detail task list ------------------------------------------------ */
.project-task-record {
    grid-template-columns: 9px minmax(0, 1fr) auto auto !important;
}

@media (max-width: 767.98px) {
    .project-task-record {
        grid-template-columns: 7px minmax(0, 1fr) !important;
    }

    .project-task-record .project-record-meta,
    .project-task-record .project-task-actions {
        grid-column: 2;
    }

    .project-task-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 575.98px) {
    .project-task-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .project-task-actions .btn {
        width: 100%;
    }
}
