/* 年間MD目標ダッシュボード専用スタイル */

/* テーブルコンテナ */
.md-target-table-container {
    position: relative;
    overflow: auto;
    max-height: 80vh;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
}

/* テーブル全体 */
.md-target-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

/* ヘッダー固定 */
.md-target-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.md-target-table thead th {
    background-color: #343a40 !important;
    color: white !important;
    font-weight: bold;
    text-align: center;
    padding: 14px;
    border-bottom: 2px solid #454d55;
    border-right: 1px solid #454d55;
    white-space: nowrap;
}

/* 左側列の固定（旬終わりまで） */
.md-target-table th:nth-child(1),
.md-target-table td:nth-child(1),
.md-target-table th:nth-child(2),
.md-target-table td:nth-child(2),
.md-target-table th:nth-child(3),
.md-target-table td:nth-child(3),
.md-target-table th:nth-child(4),
.md-target-table td:nth-child(4),
.md-target-table th:nth-child(5),
.md-target-table td:nth-child(5) {
    position: sticky;
    background-color: white;
    z-index: 5;
}

/* 各列の固定位置 */
.md-target-table th:nth-child(1),
.md-target-table td:nth-child(1) {
    left: 0;
    min-width: 100px;
}

.md-target-table th:nth-child(2),
.md-target-table td:nth-child(2) {
    left: 100px;
    min-width: 120px;
}

.md-target-table th:nth-child(3),
.md-target-table td:nth-child(3) {
    left: 220px;
    min-width: 120px;
}

.md-target-table th:nth-child(4),
.md-target-table td:nth-child(4) {
    left: 340px;
    min-width: 80px;
}

.md-target-table th:nth-child(5),
.md-target-table td:nth-child(5) {
    left: 420px;
    min-width: 80px;
    border-right: 2px solid #dee2e6 !important;
}

/* 固定列のヘッダー */
.md-target-table thead th:nth-child(1),
.md-target-table thead th:nth-child(2),
.md-target-table thead th:nth-child(3),
.md-target-table thead th:nth-child(4),
.md-target-table thead th:nth-child(5) {
    z-index: 11;
    background-color: #343a40 !important;
    color: white !important;
}

/* 固定列の影 */
.md-target-table td:nth-child(5) {
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* 奇数行の背景色 */
.md-target-table tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

.md-target-table tbody tr:nth-child(odd) td:nth-child(1),
.md-target-table tbody tr:nth-child(odd) td:nth-child(2),
.md-target-table tbody tr:nth-child(odd) td:nth-child(3),
.md-target-table tbody tr:nth-child(odd) td:nth-child(4),
.md-target-table tbody tr:nth-child(odd) td:nth-child(5) {
    background-color: #f8f9fa;
}

/* ホバー効果 */
.md-target-table tbody tr:hover {
    background-color: #e9ecef !important;
}

.md-target-table tbody tr:hover td {
    background-color: #e9ecef !important;
}

/* セルのスタイル */
.md-target-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
}

/* YTD YoY成長率の色分け */
.ytd-yoy-positive {
    background-color: #d4edda !important;
    color: #000000;
    font-weight: bold;
}

.ytd-yoy-neutral {
    background-color: #fff3cd !important;
    color: #000000;
}

.ytd-yoy-negative {
    background-color: #f8d7da !important;
    color: #000000;
}

/* 数値列の右寄せ */
.text-right {
    text-align: right;
    font-family: monospace;
}

/* 中央寄せ */
.text-center {
    text-align: center;
}