/*******************************************************
 *  Period Filter CSS（最終版 + 任意期間 横幅最適化）
 *******************************************************/

/* フィルターボタン */
.period-filter-open {
    background: #0073aa;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    margin-bottom: 12px;
}
.period-filter-open:hover {
    background: #005f87;
}

/* モーダル背景 */
.period-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
}

/* モーダル本体 */
.period-modal {
    display: none;
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    z-index: 9999;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

/* タイトル */
.period-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-modal-title {
    font-size: 20px;
    margin: 0;
}

.period-modal-close {
    background: #999;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}
.period-modal-close:hover {
    background: #777;
}

/* タブ */
.period-tabs {
    display: flex;
    margin-top: 12px;
    margin-bottom: 10px;
}
.period-tab {
    flex: 1;
    padding: 10px 8px;
    font-size: 15px;
    border: 1px solid #0073aa;
    color: #0073aa;
    background: #fff;
    cursor: pointer;
    text-align: center;
}
.period-tab.active {
    background: #0073aa;
    color: #fff;
}
.period-tab + .period-tab {
    border-left: none;
}

/* タブ内容 */
.period-tab-content {
    display: none;
    padding-top: 12px;
}
.period-tab-content.active {
    display: block;
}

/* -------------------------------
   ボタン共通デザイン
--------------------------------*/
.activity-year-btn,
.quick-btn {
    padding: 12px 18px;
    background: #f3f7fa;
    border: 1px solid #0073aa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    color: #005078;
    white-space: nowrap;
    text-align: left;
    box-sizing: border-box;
}
.activity-year-btn:hover,
.quick-btn:hover {
    background: #e8f1f7;
}

/* 活動年度（左揃え縦並び） */
.activity-year-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
    padding-left: 4px;
}

/* -------------------------------
   直近（Quick）横並びレイアウト
--------------------------------*/
.quick-select-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: flex-start;
    padding-left: 4px;
}

.quick-btn {
    min-width: 120px;
}

/* 二重文字防止 */
.quick-btn span {
    display: none !important;
}

/* --------------------------------
   モバイル最適化
-------------------------------- */
@media (max-width: 480px) {

    .period-modal {
        top: 50px;
        width: 95%;
    }

    .quick-select-list {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 12px;
        justify-content: flex-start;
    }

    .quick-btn {
        min-width: 110px;
        width: auto;
        padding: 12px 16px;
        font-size: 16px;
    }

    .activity-year-btn {
        width: 100%;
        font-size: 16px;
    }
}

/*******************************************************
 * 任意期間（開始日・終了日・適用する）
 *******************************************************/
.custom-period {
    display: flex;
    flex-direction: column;
    gap: 16px;   /* 行全体の余白 */
}

/* ラベル + input */
.custom-date-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ★ 横幅を文字数に合わせて自然な横幅に変更 */
.custom-date-row input[type="date"] {
    width: fit-content;
    max-width: 200px;
    padding: 6px 10px;
    font-size: 15px;
}

/* モバイルでは中央揃え + 幅100%で使いやすく */
@media (max-width: 480px) {
    .custom-date-row input[type="date"] {
        width: 100%;
        max-width: none;
    }
}

/* 適用ボタン（横幅縮小 & 中央揃え） */
.custom-apply-btn {
    width: fit-content;
    padding: 10px 22px;
    margin-top: 4px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    align-self: flex-start;
}

