/* ===============================
   月間練習履歴 改善版
================================ */

.history-card {
    margin-top: 22px;
}


/* 上部操作エリア */

.history-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
    padding: 18px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface-muted);
}


.history-controls {
    display: grid;
    grid-template-columns:
        minmax(200px, 280px)
        minmax(170px, 220px);

    gap: 14px;
    flex: 1;
}


.history-actions {
    display: flex;
    align-items: end;
}


.history-actions .button {
    min-width: 120px;
    white-space: nowrap;
}


/* 集計カード */

.history-summary {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
    margin-bottom: 22px;
}


.summary-card {
    position: relative;

    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: #ffffff;

    text-align: left;

    overflow: hidden;
}


.summary-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 4px;
    height: 100%;

    background: var(--primary);
}


.summary-label {
    display: block;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 0.8rem;
    font-weight: 700;
}


.summary-card strong {
    display: block;

    color: var(--text);

    font-size: 1.45rem;
    line-height: 1.2;
}


/* 練習時間 */

.history-duration {
    color: var(--primary);
    font-weight: 800;
}


/* 履歴テーブル */

.history-card .table-wrapper {
    border: 1px solid var(--border);
    border-radius: 14px;

    overflow-x: auto;
}


.history-card table {
    margin: 0;
}


.history-card th {
    background: var(--surface-muted);
}


.history-card tbody tr:last-child td {
    border-bottom: none;
}


/* スマートフォン */

@media screen and (max-width: 760px) {

    .history-toolbar {
        display: block;

        padding: 15px;
    }


    .history-controls {
        grid-template-columns: 1fr;
    }


    .history-actions {
        margin-top: 14px;
    }


    .history-actions .button {
        width: 100%;
    }


    .history-summary {
        grid-template-columns:
            repeat(3, minmax(100px, 1fr));

        gap: 8px;
    }


    .summary-card {
        padding: 14px 10px 14px 14px;
    }


    .summary-label {
        font-size: 0.7rem;
    }


    .summary-card strong {
        font-size: 1rem;
    }

}


@media screen and (max-width: 480px) {

    .history-summary {
        grid-template-columns: 1fr;
    }


    .summary-card {
        text-align: left;
    }

}

