﻿/* ========================================
   House Tasks Kanban
   Skyblue / White Masterdata Stil
   ======================================== */

.tasks-page {
    position: relative;
    padding-bottom: 48px;
}

/* ---------- Page Header ---------- */

.tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 4px 2px 14px 2px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

    .htd-header-left,
    .tasks-header .htd-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex-wrap: wrap;
    }

    .htd-header-right,
    .tasks-header .htd-header-right {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

.tasks-title,
.htd-title {
    font-weight: 900;
    letter-spacing: -0.035em;
    color: var(--rr-text-strong, #0f172a);
}

.tasks-chip,
.htd-chip {
    border-radius: 999px !important;
    border-color: rgba(0, 0, 0, 0.35) !important;
    color: #374151 !important;
    background: rgba(250, 250, 250, 0.78) !important;
    font-weight: 750 !important;
}

/* ---------- State Cards ---------- */

.tasks-state-card,
.tasks-empty-card {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.86));
    padding: 24px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
}

.tasks-empty-card {
    min-height: 230px;
    display: grid;
    place-items: center;
    text-align: center;
    border-style: dashed;
}

.tasks-empty-title {
    font-weight: 850;
    color: var(--rr-text-strong, #0f172a);
}

.tasks-empty-text {
    max-width: 520px;
}

/* ---------- Main Shell ---------- */

.tasks-kanban-shell {
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.86));
    padding: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ---------- Kanban Root ---------- */

.htd-root {
    padding: 0;
}

    /* ---------- Inner Header ---------- */

    .htd-root > .htd-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        flex-wrap: wrap;
        padding: 4px 0 14px 0;
        margin-bottom: 14px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.14);
    }

.htd-btn-primary {
    border-radius: 12px !important;
    text-transform: none !important;
    font-weight: 850 !important;
    padding-inline: 16px !important;
    box-shadow: none !important;
}

/* ---------- Filters ---------- */

.htd-filters {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.84));
    padding: 16px;
    margin-bottom: 12px;
}

.htd-input .mud-input-root,
.htd-input .mud-input-control {
    background: rgba(255, 255, 255, 0.9);
}

.htd-input .mud-input-outlined-border {
    border-color: rgba(0, 0, 0, 0.22) !important;
}

.htd-input .mud-input-root:hover .mud-input-outlined-border {
    border-color: rgba(0, 0, 0, 0.40) !important;
}

/* ---------- Loading ---------- */

.htd-loading {
    min-height: 220px;
    display: grid;
    place-items: center;
    gap: 10px;
    text-align: center;
}

.htd-muted,
.obj-muted {
    color: var(--rr-text-secondary, #64748b);
    line-height: 1.4;
}

/* ---------- Tabs ---------- */

.htd-task-tabs {
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    overflow: hidden;
    margin-top: 12px !important;
}

    .htd-task-tabs .mud-tabs-toolbar {
        padding: 0 14px;
        background: rgba(255, 255, 255, 0.82);
        border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    }

    .htd-task-tabs .mud-tab {
        min-height: 48px;
        text-transform: none;
        font-weight: 850;
        color: #475569;
    }

        .htd-task-tabs .mud-tab.mud-tab-active {
            color: var(--rr-text-strong, #0f172a);
        }

    .htd-task-tabs .mud-tabs-panels {
        padding: 16px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 250, 0.74));
    }

    .htd-task-tabs .mud-tabs-panel {
        padding: 0 !important;
    }

/* ---------- Kanban Board ---------- */

.htd-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(230px, 1fr));
    gap: 14px;
    align-items: stretch;
    width: 100%;
}

.htd-column {
    min-width: 0;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 16px;
    background: rgba(250, 250, 250, 0.62);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.htd-lanehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px;
    background: rgba(245, 245, 245, 0.86);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.htd-lane-title {
    font-weight: 900;
    color: var(--rr-text-strong, #0f172a);
}

.htd-lane-sub {
    min-width: 26px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.24);
    background: rgba(255, 255, 255, 0.90);
    color: #334155;
    font-size: 0.82rem;
    font-weight: 850;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.htd-dropzone {
    flex: 1 1 auto;
    min-height: 350px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Task Cards ---------- */

.htd-card {
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.86));
    padding: 13px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

    .htd-card:hover {
        transform: translateY(-1px);
        border-color: rgba(0, 0, 0, 0.28);
        background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(245, 245, 245, 0.92));
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
    }

    .htd-card.clickable,
    .clickable {
        cursor: pointer;
    }

.htd-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.htd-card-title {
    font-weight: 900;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.25;
    word-break: break-word;
}

.htd-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

    .htd-card-actions .mud-icon-button {
        width: 30px;
        height: 30px;
        padding: 4px;
        border-radius: 999px;
        border: 1px solid rgba(0, 0, 0, 0.12);
        background: rgba(248, 250, 252, 0.88);
    }

        .htd-card-actions .mud-icon-button:hover {
            background: rgba(241, 245, 249, 1);
        }

.htd-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0 8px 0;
}

.htd-card .mud-chip-root {
    border-radius: 999px !important;
    border-color: rgba(0, 0, 0, 0.28) !important;
    background: rgba(250, 250, 250, 0.78) !important;
    color: #374151 !important;
    font-weight: 750 !important;
}

.htd-prio {
    font-weight: 850 !important;
}

.htd-card-desc {
    margin-top: 8px;
    color: #475569;
    line-height: 1.35;
    word-break: break-word;
}

/* ---------- Recurring Tasks Tab ---------- */

.htd-recurring-tab {
    padding: 4px 0 2px 0;
}

.htd-recurring {
    width: 100%;
}

.htd-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 2px 2px 0 2px;
}

    .htd-section-head .mud-typography-subtitle1 {
        font-weight: 900;
        color: var(--rr-text-strong, #0f172a);
        letter-spacing: -0.01em;
    }

.htd-recurring-tab .mud-grid {
    margin-top: 0;
}

.htd-recurring-tab .mud-grid-item {
    padding-top: 10px;
}

.htd-recurring-card {
    height: 100%;
    min-height: 156px;
    padding: 14px;
    border-radius: 15px !important;
    border: 1px solid rgba(0, 0, 0, 0.14) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.86)) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

    .htd-recurring-card:hover {
        transform: translateY(-1px);
        border-color: rgba(0, 0, 0, 0.28) !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(245, 245, 245, 0.92)) !important;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
    }

    .htd-recurring-card .mud-chip-root {
        min-height: 28px;
    }

    .htd-recurring-card .mud-stack {
        margin-top: 10px !important;
        margin-bottom: 8px;
    }

/* ---------- MudBlazor Polish ---------- */

.htd-root .mud-button-root,
.tasks-page .mud-button-root {
    border-radius: 12px;
    text-transform: none;
    font-weight: 750;
}

.htd-root .mud-input-control {
    margin-top: 0;
}

.htd-root .mud-alert {
    border-radius: 16px;
}

.htd-root .mud-chip-root {
    max-width: 100%;
}

.htd-root .mud-chip-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
    .htd-board {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }

    .htd-dropzone {
        min-height: 260px;
    }
}

@media (max-width: 900px) {
    .tasks-kanban-shell {
        padding: 12px;
        border-radius: 20px;
    }

    .htd-task-tabs .mud-tabs-panels {
        padding: 12px;
    }

    .htd-board {
        grid-template-columns: 1fr;
    }

    .htd-dropzone {
        min-height: 180px;
    }
}

@media (max-width: 760px) {
    .tasks-header,
    .htd-root > .htd-header {
        align-items: stretch;
    }

        .htd-header-left,
        .htd-header-right,
        .tasks-header .htd-header-left,
        .tasks-header .htd-header-right {
            width: 100%;
        }

        .htd-header-right,
        .tasks-header .htd-header-right {
            justify-content: flex-start;
            margin-left: 0;
        }

    .htd-btn-primary {
        width: 100%;
        justify-content: center;
    }

    .htd-filters {
        padding: 14px;
        border-radius: 16px;
    }

    .htd-task-tabs .mud-tabs-toolbar {
        padding: 0 10px;
    }

    .htd-task-tabs .mud-tab {
        min-width: auto;
        padding-inline: 10px;
        font-size: 0.86rem;
    }

    .htd-card-top {
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .tasks-page {
        padding-bottom: 32px;
    }

    .tasks-kanban-shell {
        padding: 10px;
    }

    .htd-task-tabs .mud-tabs-panels {
        padding: 10px;
    }

    .htd-column {
        border-radius: 14px;
    }

    .htd-lanehead {
        padding: 12px;
    }

    .htd-dropzone {
        padding: 10px;
    }

    .htd-card,
    .htd-recurring-card {
        padding: 12px;
    }

    .htd-card-actions .mud-icon-button {
        width: 28px;
        height: 28px;
    }
}
