.page-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 22px;
}

.page-header h1 {
    font-size: calc(27px * var(--text-scale, 1));

    margin-bottom: 5px;
}

.page-header p {
    color: #777;

    font-size: calc(13px * var(--text-scale, 1));
}

.page-header-actions {
    display: flex;

    align-items: center;

    gap: 10px;
}


/* TABS */

.task-tabs {
    display: flex;

    gap: 6px;

    margin-bottom: 18px;
}

.task-tab {
    border: 1px solid #ddd;

    background: white;

    padding: 9px 13px;

    border-radius: 9px;

    font-size: calc(13px * var(--text-scale, 1));

    font-weight: 700;
}

.task-tab.active {
    color: #c50000;

    border-color: #c50000;

    background: #fff4f4;
}


/* GRID */

.tasks-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(290px, 1fr)
        );

    gap: 16px;
}


/* CARD */

.task-card {
    background: white;

    border: 1px solid #eaeaea;

    border-radius: 16px;

    padding: 19px;

    box-shadow:
        0 4px 15px
        rgba(0, 0, 0, 0.03);
}

.task-card-header {
    display: flex;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 12px;
}

.task-card h3 {
    font-size: calc(17px * var(--text-scale, 1));

    line-height: 1.35;
}

.status-badge {
    height: fit-content;

    padding: 5px 8px;

    border-radius: 20px;

    font-size: calc(10px * var(--text-scale, 1));

    font-weight: 800;
}

.status-active {
    color: #16833c;

    background: #eafff0;
}

.status-completed {
    color: #315c94;

    background: #edf5ff;
}

.my-task {
    border-color: #e4aaaa;
}

.my-task-label {
    display: inline-block;

    margin-bottom: 10px;

    padding: 5px 8px;

    border-radius: 7px;

    background: #fff0f0;

    color: #b70000;

    font-size: calc(11px * var(--text-scale, 1));

    font-weight: 700;
}

.task-description {
    color: #666;

    line-height: 1.5;

    font-size: calc(13px * var(--text-scale, 1));

    margin-bottom: 14px;
}

.task-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-bottom: 14px;
}

.task-meta span {
    background: #f4f4f5;

    padding: 6px 8px;

    border-radius: 7px;

    font-size: calc(11px * var(--text-scale, 1));

    color: #555;
}

.task-meta .xp {
    color: #856100;

    background: #fff6d9;

    font-weight: 700;
}

.task-assignees {
    border-top:
        1px solid #eeeeee;

    padding-top: 12px;
}

.task-assignees-title {
    margin-bottom: 7px;

    color: #888;

    font-size: calc(11px * var(--text-scale, 1));
}

.assignee-list {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;
}

.assignee {
    padding: 5px 7px;

    border-radius: 7px;

    background: #f3f3f5;

    font-size: calc(10px * var(--text-scale, 1));
}

.task-updated {
    margin-top: 13px;

    color: #999;

    font-size: calc(10px * var(--text-scale, 1));
}




.task-action {
    border: none;

    padding: 8px 10px;

    border-radius: 8px;

    font-size: calc(11px * var(--text-scale, 1));

    font-weight: 700;
}

.task-edit {
    color: #444;

    background: #eeeeef;
}

.task-complete {
    color: white;

    background: #19904b;
}

.task-delete {
    color: #b60000;

    background: #fff0f0;
}


/* EMPTY */

.empty-state {
    grid-column: 1 / -1;

    padding: 45px 20px;

    text-align: center;

    background: white;

    border: 1px solid #eaeaea;

    border-radius: 15px;

    color: #777;

    font-size: calc(13px * var(--text-scale, 1));
}


/* VOLUNTEER FILTER */

.mine-filter {
    display: flex;

    align-items: center;

    gap: 9px;

    background: white;

    border: 1px solid #ddd;

    border-radius: 10px;

    padding: 10px 12px;

    cursor: pointer;

    font-size: calc(12px * var(--text-scale, 1));

    font-weight: 700;
}

.mine-filter input {
    width: 17px;

    height: 17px;

    accent-color: #c50000;
}


/* MODAL */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 100;

    background:
        rgba(0, 0, 0, 0.45);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 18px;
}

.task-modal {
    width: 100%;

    max-width: 650px;

    max-height: 92vh;

    overflow-y: auto;

    background: white;

    border-radius: 20px;

    padding: 24px;
}

.modal-header {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    border-bottom:
        1px solid #eeeeee;

    padding-bottom: 18px;

    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: calc(21px * var(--text-scale, 1));

    margin-bottom: 4px;
}

.modal-header p {
    color: #777;

    font-size: calc(12px * var(--text-scale, 1));
}

.modal-close {
    border: none;

    width: 36px;

    height: 36px;

    border-radius: 9px;

    background: #f3f3f3;

    font-size: calc(22px * var(--text-scale, 1));
}

.task-form-group {
    margin-bottom: 17px;
}

.task-form-group > label {
    display: block;

    margin-bottom: 7px;

    font-size: calc(12px * var(--text-scale, 1));

    font-weight: 700;
}

.task-form-group input,
.task-form-group textarea,
.task-form-group select {
    width: 100%;

    padding: 12px 13px;

    border: 1px solid #ddd;

    border-radius: 9px;

    outline: none;
}

.task-form-group textarea {
    min-height: 100px;

    resize: vertical;
}

.task-form-group input:focus,
.task-form-group textarea:focus,
.task-form-group select:focus {
    border-color: #c50000;
}

.task-form-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;
}

.recurring-options {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;
}

.recurring-option input {
    display: none;
}

.recurring-option span {
    display: block;

    border: 1px solid #ddd;

    padding: 10px;

    text-align: center;

    border-radius: 9px;

    font-size: calc(12px * var(--text-scale, 1));

    font-weight: 700;
}

.recurring-option input:checked + span {
    border-color: #c50000;

    color: #c50000;

    background: #fff3f3;
}

.members-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 8px;
}

.members-header button {
    border: none;

    background: none;

    color: #c50000;

    font-weight: 700;

    font-size: calc(11px * var(--text-scale, 1));
}

.members-list {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 8px;
}

.member {
    display: flex;

    align-items: center;

    gap: 9px;

    border: 1px solid #e5e5e5;

    border-radius: 9px;

    padding: 10px;
}

.member input {
    width: 16px;

    height: 16px;

    accent-color: #c50000;
}

.member strong {
    display: block;

    font-size: calc(12px * var(--text-scale, 1));
}

.member small {
    color: #888;

    font-size: calc(10px * var(--text-scale, 1));
}

.modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 8px;

    border-top:
        1px solid #eeeeee;

    padding-top: 18px;

    margin-top: 20px;
}

.modal-error {
    min-height: 18px;

    color: #c50000;

    font-size: calc(12px * var(--text-scale, 1));
}


@media (max-width: 700px) {

    .page-header {
        align-items:
            flex-start;

        flex-direction:
            column;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions > * {
        flex: 1;
    }

    .task-form-row {
        grid-template-columns:
            1fr;
    }

    .members-list {
        grid-template-columns:
            1fr;
    }

}


@media (max-width: 430px) {

    .tasks-grid {
        grid-template-columns:
            1fr;
    }

    .page-header h1 {
        font-size: calc(21px * var(--text-scale, 1));
    }

    .task-modal {
        padding: 16px;
    }

}

/* =========================
KALAN SÜRE
========================= */

.task-countdown {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 8px;

    padding: 10px;

    margin-bottom: 14px;

    border-radius: 10px;

    border: 1px solid transparent;
}


.task-countdown > div {
    display: flex;

    flex-direction: column;

    gap: 3px;
}


.task-countdown small {
    font-size: calc(9px * var(--text-scale, 1));

    opacity: 0.75;
}


.task-countdown strong {
    font-size: calc(12px * var(--text-scale, 1));
}


/* RAHAT */

.urgency-safe {
    background: #effbf3;

    border-color: #cdebd7;

    color: #1e7540;
}


/* 3 GÜNDEN AZ */

.urgency-warning {
    background: #fff8e6;

    border-color: #f5dda1;

    color: #946b00;
}


/* 24 SAATTEN AZ */

.urgency-urgent {
    background: #fff0e5;

    border-color: #ffccac;

    color: #ad4d00;
}


/* 6 SAATTEN AZ */

.urgency-critical {
    background: #fff0f0;

    border-color: #efb6b6;

    color: #b00000;
}


/* SÜRESİ GEÇMİŞ */

.urgency-overdue {
    background: #bd0000;

    border-color: #bd0000;

    color: white;

    animation:
        overdueBlink
        0.85s
        infinite;
}


@keyframes overdueBlink {

    0% {
        opacity: 1;

        transform:
            scale(1);
    }

    50% {
        opacity: 0.48;

        transform:
            scale(0.985);
    }

    100% {
        opacity: 1;

        transform:
            scale(1);
    }

}


/* =========================
SONUÇ
========================= */

.task-result {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 10px 12px;

    margin-bottom: 14px;

    border-radius: 10px;

    background: #effbf3;

    color: #16753b;

    font-size: calc(11px * var(--text-scale, 1));
}


.task-result strong {
    font-size: calc(13px * var(--text-scale, 1));
}


.task-result .negative-xp {
    color: #b00000;
}


/* =========================
TAMAMLAYAN
========================= */

.completed-by {
    margin-top: 11px;

    padding: 8px 10px;

    border-radius: 8px;

    background: #f4f4f5;

    color: #666;

    font-size: calc(10px * var(--text-scale, 1));
}


.completed-by strong {
    color: #333;
}


/* =========================
TESLİM DOSYALARI
========================= */

.completion-file {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    padding: 9px 10px;

    margin-bottom: 6px;

    border: 1px solid #e5e5e5;

    border-radius: 8px;

    background: #fafafa;

    font-size: calc(11px * var(--text-scale, 1));
}


.completion-file span {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.completion-file button {
    border: none;

    background: #fff0f0;

    color: #bd0000;

    padding: 5px 8px;

    border-radius: 6px;

    font-size: calc(9px * var(--text-scale, 1));

    font-weight: 700;
}


.empty-completion-files {
    padding: 12px;

    background: #f5f5f5;

    border-radius: 8px;

    color: #888;

    font-size: calc(10px * var(--text-scale, 1));
}

/* =====================================================
   GÖREV KARTLARINI HİZALA
===================================================== */

.tasks-grid {
    align-items: stretch;
}


/* Kartın bütün yapısı */
.task-card {
    display: flex;
    flex-direction: column;

    height: 100%;
    min-height: 460px;

    box-sizing: border-box;
}


/* =====================================================
   BAŞLIK
===================================================== */

.task-card-header {
    min-height: 52px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 10px;
}


.task-card-header h3 {
    margin: 0;

    line-height: 1.35;

    /* Maksimum 2 satır */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =====================================================
   KALAN SÜRE / XP
===================================================== */

.task-countdown {
    min-height: 62px;
    box-sizing: border-box;
}


/* =====================================================
   AÇIKLAMA
===================================================== */

.task-description {
    min-height: 58px;
    max-height: 58px;

    margin: 12px 0;

    line-height: 1.45;

    overflow: hidden;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}


/* =====================================================
   TARİH / SAAT / EKİP BİLGİLERİ
===================================================== */

.task-meta {
    min-height: 58px;

    align-content: flex-start;
}


/* =====================================================
   GÖREVLENDİRİLEN KİŞİLER
===================================================== */

.task-assignees {
    min-height: 72px;
    margin-top: 10px;
}


.assignee-list {
    max-height: 46px;

    overflow-y: auto;

    align-content: flex-start;
}


/* scrollbar çok göze batmasın */
.assignee-list::-webkit-scrollbar {
    width: 3px;
}


.assignee-list::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 10px;
}


/* =====================================================
   TAMAMLAYAN / SON GÜNCELLEME
===================================================== */

.completed-by {
    min-height: 34px;
    box-sizing: border-box;
}


.task-updated {
    min-height: 36px;

    margin-top: 10px;
}


/* =====================================================
   BUTONLAR
===================================================== */

.task-actions {

    /*
      BÜTÜN FARK BURADA.
      Üstte ne kadar içerik olursa olsun
      butonları kartın dibine iter.
    */
    margin-top: auto;

    padding-top: 14px;

    display: flex;
    align-items: center;

    gap: 7px;
}


.task-actions .task-action {
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    white-space: nowrap;
}
/* =====================================================
   DİNAMİK SATIR HİZALAMA
===================================================== */


/*
   Grid her yatay satırdaki kartları
   kendi satırının en yüksek kartına göre uzatır.
*/

.tasks-grid {
    align-items: stretch;
}


/*
   Kartın kendisi
*/

.task-card {
    display: flex;
    flex-direction: column;

    height: 100%;

    min-height: 0;

    box-sizing: border-box;
}


/*
   ARTIK SABİT HEIGHT YOK.
   JS her satıra göre min-height verecek.
*/

.task-card-header {
    height: auto;
    min-height: 0;
}


.task-countdown,
.task-result {
    height: auto;
    min-height: 0;

    box-sizing: border-box;
}


/*
   Başlık maksimum 3 satır.
   Aynı yatay satırdaki diğer kartlar
   otomatik olarak en uzuna göre boşluk alacak.
*/

.task-card-header h3 {
    display: -webkit-box;

    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/*
   Açıklama maksimum 4 satır.
*/

.task-description {
    height: auto;

    min-height: 0;
    max-height: none;

    display: -webkit-box;

    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;

    overflow: hidden;
}


/*
   Tarih / saat / ekip alanı
*/

.task-meta {
    height: auto;

    min-height: 0;
    max-height: none;

    overflow: visible;

    align-content: flex-start;
}


/*
   Görevlendirilen kişiler
*/

.task-assignees {
    height: auto;

    min-height: 0;
    max-height: none;

    overflow: visible;

    box-sizing: border-box;
}


.assignee-list {
    max-height: none;

    overflow: visible;
}


/*
   Tamamlayan
*/

.completed-by {
    height: auto;
    min-height: 0;

    box-sizing: border-box;
}


/*
   Son güncelleme
*/

.task-updated {
    height: auto;
    min-height: 0;

    box-sizing: border-box;
}


/*
   Buton her durumda kartın dibinde.
*/

.task-actions {
    margin-top: auto;

    padding-top: 14px;

    display: flex;
    align-items: flex-end;

    gap: 7px;   
}


.task-actions .task-action {
    height: 36px;
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    white-space: nowrap;
}
.my-task-label-slot {
    min-height: 0;
}