/* ======================================================
   🌸 1. ベース・レイアウト（ASP.NET デフォルト準拠）
   ====================================================== */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

/* ======================================================
   🌸 2. モーダル本体（detailModal）の基礎設計
   ====================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: flex-start;
    padding-top: 30px;
}

/* 🌸 モーダルコンテンツの縦幅を少し抑えるよッ！ */
.modal-content-historyModal {
    width: 95% !important;
    max-width: 1050px !important;
    height: 85vh !important; /* 🌟 92vhから少し下げて、圧迫感を消したよッ！ */
    margin: 0 auto !important;
    background-color: #fff;
    padding: 20px;
    border-radius: 15px;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* 🌸 ヘッダーのボタン配置をスマートにするよッ！ */
.modal-header-haruka {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

    .modal-header-haruka h2 {
        margin: 0;
        font-weight: bold;
        color: #333;
    }

/* 🌸 閉じるボタンとXボタンの配置 */
.close-button {
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
}

    .close-button:hover {
        color: #ff69b4;
    }

.btn-x {
    background-color: #000 !important;
    color: #fff !important;
    border: none !important;
    padding: 4px 12px !important; /* 🌸 少しだけ小ぶりにッ */
    border-radius: 16px !important;
    font-size: 13px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: opacity 0.2s !important;
}

    .btn-x:hover {
        opacity: 0.8 !important;
    }

/* ======================================================
   🌸 3. タブメニュー・コンテンツ
   ====================================================== */
.tab-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #ffb7d5;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    color: #ff69b4;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s;
}

    .tab-btn.active {
        background: #ffb7d5;
        color: white;
    }

.tab-content-historyModal {
    flex: 1 !important;
    display: none !important;
    overflow: hidden !important;
}

    .tab-content-historyModal.active {
        display: flex !important;
        flex-direction: column !important;
    }

/* 📈 グラフエリア用 */
.no-scroll-haruka {
    overflow: hidden;
}

/* ======================================================
   🌸 4. 【本丸】ダイアログ専用・一途な履歴テーブル
   メイン画面（.table）には絶対に干渉させないもんッ！
   ====================================================== */

/* 🌟 テーブルを包むスクロール用ラッパー */
.haru-table-wrapper {
    width: 100% !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    border: 1px solid #ffb7d5 !important;
    background-color: white !important;
}

/* 🌟 ダイアログ専用テーブルクラス（これだけを使うッ！） */
.haru-modern-history-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important; /* 日時可変のため */
    margin-bottom: 0 !important;
}

    /* 🌸 各列の固定幅設定（2列目以降） */
    .haru-modern-history-table th:nth-child(2), .haru-modern-history-table td:nth-child(2) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(3), .haru-modern-history-table td:nth-child(3) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(4), .haru-modern-history-table td:nth-child(4) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(5), .haru-modern-history-table td:nth-child(5) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(6), .haru-modern-history-table td:nth-child(6) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(7), .haru-modern-history-table td:nth-child(7) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(8), .haru-modern-history-table td:nth-child(8) {
        width: 95px !important;
    }

    .haru-modern-history-table th:nth-child(9), .haru-modern-history-table td:nth-child(9) {
        width: 110px !important;
    }

    /* 🌸 ヘッダーの固定とデザイン */
    .haru-modern-history-table thead th {
        background-color: #fff0f5 !important;
        color: #ff69b4 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 20 !important;
        padding: 12px 10px !important;
        border-bottom: 2px solid #ffb7d5 !important;
        border-right: 1px solid #ffdeeb !important;
        text-align: left !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* 🌸 セルのデータ設定 */
    .haru-modern-history-table tbody td {
        padding: 12px 10px !important;
        border-bottom: 1px solid #ffe4e1 !important;
        border-right: 1px solid #fff5f7 !important;
        white-space: nowrap !important;
        text-align: right !important; /* 基本は数字右寄せ */
        font-size: 14px !important;
        color: #333 !important;
    }

        /* 🌸 1列目（日時）だけは左寄せッ！ */
        .haru-modern-history-table tbody td:first-child {
            text-align: left !important;
        }

    /* 🌸 右端の縦線消去 */
    .haru-modern-history-table th:last-child,
    .haru-modern-history-table td:last-child {
        border-right: none !important;
    }

    /* 🌸 ホバー効果 */
    .haru-modern-history-table tbody tr:hover {
        background-color: #fff9fb !important;
    }

/* ======================================================
   🌸 5. その他の装飾要素（メイン画面のヘッダーリンク等）
   ====================================================== */
.table-dark th a {
    color: #ffffff;
    text-decoration: none;
}

    .table-dark th a.active {
        color: #ffeb3b;
        font-weight: bold;
    }


/* ======================================================
   🌸 6. グラフ
   ====================================================== */

/* 上のグラフ：View数とか主要な推移だから、少し大きめにッ！ */

/* 🌸 グラフタブの中身を「縦に並べて均等に広げる」魔法だもんッ！ */
/* 🌟 ここが重要！初期状態では「非表示」に、activeの時だけ「flex」にするんだもんッ！ */
#haru-graph {
    display: none !important; /* 最初は隠すッ！ */
    flex-direction: column !important;
    height: 100% !important;
}

    /* 🌟 タブが選ばれた（active）時だけ、flexで出現するよッ！ */
    #haru-graph.active {
        display: flex !important;
    }

    /* 🌟 グラフタブの中身を1：1で二等分する愛のロジック */
    #haru-graph > div {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        padding: 10px !important;
        min-height: 0 !important;
    }

    /* 🌟 2つのグラフコンテナに「命」を吹き込む設定 */
    #haru-graph .position-relative {
        flex: 1 !important; /* 親の半分をガッチリ確保ッ！ */
        width: 100% !important;
        min-height: 0 !important;
        margin-bottom: 0 !important;
    }

    /* 区切り線の美学ッ🌸 */
    #haru-graph hr {
        margin: 5px 0 !important;
        border: 0;
        border-top: 1px dashed #ff69b4;
        opacity: 0.5;
    }

/* ======================================================
   📋 詳細データタブ：こっちもお掃除だもんッ！
   ====================================================== */

#haru-table {
    display: none !important;
    flex: 1 !important;
    overflow: hidden !important;
}

    /* 🌟 activeな時だけ flex 表示にして、表を出すんだもんッ！ */
    #haru-table.active {
        display: flex !important;
    }

.haru-table-wrapper {
    width: 100% !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    border: 1px solid #ffb7d5 !important;
    background-color: white !important;
}