/* dashboard schedule only */

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* section */

.dash-section {
    width: 100%;
    padding: 24px;
    border: 1px solid #292929;
    border-left: 4px solid var(--section-color, #4F8CFF);
    border-radius: 24px;
    background: #181818;
}

.dash-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.dash-section-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.section-color-dot {
    width: 11px;
    height: 11px;
    margin-top: 9px;
    border-radius: 50%;
    background: var(--section-color, #4F8CFF);
}

.dash-section-head h2 {
    margin: 0;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.dash-section-head p {
    margin: 7px 0 0;
    color: #888;
    font-size: 14px;
}

.color-circle {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.color-circle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.color-circle span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #333;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tree-line {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.tree-line strong {
    display: block;
}

.tree-line span {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 13px;
}

.todo-state {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.state-btn {
    height: 28px;
    padding: 0 9px;
    border: 1px solid #333;
    border-radius: 8px;
    background: transparent;
    color: #777;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.state-btn.done.active {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34,197,94,.12);
}

.state-btn.fail.active {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239,68,68,.12);
}

.state-btn.delete.active {
    border-color: #888;
    color: #fff;
    background: rgba(255,255,255,.08);
}

.tree-item.done .tree-line strong {
    color: #22c55e;
}

.tree-item.fail .tree-line strong {
    color: #ef4444;
}

.tree-item.deleted .tree-line strong,
.tree-item.deleted .tree-line span {
    color: #666;
    text-decoration: line-through;
}

/* detail popup */

.schedule-detail-popup {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 34px;
    border-radius: 22px;
    background: #181818;
    border: 1px solid #2a2a2a;
    color: #fff;
}

.schedule-detail-popup h2 {
    margin: 0 0 24px;
    font-size: 26px;
    font-weight: 900;
}

.detail-row {
    padding: 16px 0;
    border-bottom: 1px solid #292929;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row span {
    display: block;
    margin-bottom: 8px;
    color: #777;
    font-size: 13px;
}

.detail-row strong {
    color: #fff;
    font-size: 16px;
}

.detail-row p {
    margin: 0;
    color: #ccc;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .tree-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .todo-state {
        width: 100%;
    }

    .state-btn {
        flex: 1;
    }

    .schedule-detail-popup {
        padding: 28px 22px;
        border-radius: 18px;
    }
}

/* wrapper */

.depth-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* today tree list */

.tree-list {
    padding: 16px;
    border-radius: 18px;
    background: #111;
}

.tree-item {
    position: relative;
    min-height: 38px;
}

.tree-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
}

.tree-line:hover {
    background: #1f1f1f;
}

.tree-line strong {
    color: #ddd;
    font-size: 15px;
    font-weight: 700;
}

.tree-line span {
    color: #888;
    font-size: 13px;
    white-space: nowrap;
}

.tree-item.depth-1 {
    padding-left: 0;
}

.tree-item.depth-1 .tree-line strong {
    color: var(--section-color, #4F8CFF);
    font-weight: 900;
}

.tree-item.depth-2 {
    padding-left: 28px;
}

.tree-item.depth-3 {
    padding-left: 56px;
}

.tree-item.depth-4 {
    padding-left: 84px;
}

.tree-item.depth-5 {
    padding-left: 112px;
}

.tree-item.depth-2::before,
.tree-item.depth-3::before,
.tree-item.depth-4::before,
.tree-item.depth-5::before {
    content: "└";
    position: absolute;
    top: 8px;
    color: #555;
    font-size: 16px;
    line-height: 1;
}

.tree-item.depth-2::before {
    left: 8px;
}

.tree-item.depth-3::before {
    left: 36px;
}

.tree-item.depth-4::before {
    left: 64px;
}

.tree-item.depth-5::before {
    left: 92px;
}

/* card block */

.depth-item {
    border-radius: 18px;
    background: #111;
    overflow: hidden;
}

.depth-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    padding: 0 16px;
    border-bottom: 1px solid #222;
}

.depth-main strong {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.depth-main span {
    color: #888;
    font-size: 13px;
    white-space: nowrap;
}

/* goal */

.goal-box {
    padding: 20px;
}

.goal-percent {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--section-color, #4F8CFF);
}

.progress-bar {
    width: 100%;
    height: 12px;
    margin: 18px 0;
    border-radius: 999px;
    background: #242424;
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--section-color, #4F8CFF);
}

.goal-text {
    margin: 0;
    color: #888;
    font-size: 14px;
}

/* schedule table */

.schedule-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.schedule-row {
    display: grid;
    grid-template-columns: 100px 1fr 100px;
    align-items: center;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 14px;
    background: #181818;
    color: #aaa;
}

.schedule-head {
    min-height: 36px;
    background: transparent;
    color: #777;
    font-size: 13px;
    font-weight: 800;
}

.schedule-row:not(.schedule-head):hover {
    background: #202020;
}

.state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.state.done {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

.state.ing {
    background: rgba(255,255,255,0.1);
    color: #ddd;
}

.state.wait {
    background: #222;
    color: #888;
}

.schedule-empty {
    padding: 54px 20px;
    border-radius: 18px;
    background: #111;
    text-align: center;
}

.schedule-empty strong {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.schedule-empty p {
    margin: 10px 0 0;
    color: #777;
    font-size: 14px;
}

/* responsive */

@media (max-width: 1024px) {
    .dash-hero {
        padding: 28px;
    }
}

@media (max-width: 640px) {
    .dashboard-page {
        gap: 16px;
    }

    .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
        border-radius: 22px;
    }

    .dash-hero h1 {
        font-size: 30px;
    }

    .dash-add-btn {
        width: 100%;
    }

    .dash-section {
        padding: 20px;
        border-radius: 20px;
    }

    .dash-section-head {
        align-items: flex-start;
    }

    .tree-list {
        padding: 12px;
    }

    .tree-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 10px;
    }

    .tree-line span {
        white-space: normal;
    }

    .tree-item.depth-2 {
        padding-left: 22px;
    }

    .tree-item.depth-3 {
        padding-left: 44px;
    }

    .tree-item.depth-4 {
        padding-left: 66px;
    }

    .tree-item.depth-5 {
        padding-left: 88px;
    }

    .tree-item.depth-2::before {
        left: 6px;
    }

    .tree-item.depth-3::before {
        left: 28px;
    }

    .tree-item.depth-4::before {
        left: 50px;
    }

    .tree-item.depth-5::before {
        left: 72px;
    }

    .depth-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 14px 16px;
    }

    .depth-main span {
        white-space: normal;
    }

    .goal-percent {
        font-size: 44px;
    }

    .schedule-table {
        padding: 12px;
    }

    .schedule-row {
        grid-template-columns: 52px 1fr;
        gap: 8px;
        padding: 14px;
    }

    .schedule-row > div:nth-child(3) {
        grid-column: 2;
    }
}