:root {
    /* カラーパレット */
    --main-color: #03A9F4;
    --main-hover: #0288D1;
    --main-hover-darker: #0277BD;
    --accent-blue: #4FC3F7;
    --light-bg: #E1F5FE;
    --sidebar-bg: #37474F;
    --text-color: #333333;
    --gray-light: #f5fafd;
    --gray-medium: #cfd8dc;
}

/* ========== ベース ========== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: var(--text-color);
    overflow: hidden;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* ========== ボタンスタイル ========== */
.btn-primary {
    background-color: var(--main-color) !important;
    border-color: var(--main-color) !important;
    color: #fff !important;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--main-hover) !important;
        border-color: var(--main-hover) !important;
        color: #fff !important;
    }

    .btn-primary:active {
        background-color: var(--main-hover-darker) !important;
        border-color: var(--main-hover-darker) !important;
        color: #fff !important;
    }

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--main-color);
}

/* ========== ページネーション ========== */
.page-item.active .page-link {
    background-color: var(--main-color) !important;
    border-color: var(--main-color) !important;
    color: #fff !important;
}

.page-link {
    color: var(--main-color);
    border: 1px solid var(--gray-medium);
    transition: all 0.2s;
}

    .page-link:hover {
        background-color: var(--light-bg);
        border-color: var(--main-hover);
        color: var(--main-hover);
    }

/* ========== ヘッダー ========== */
#header {
    background-color: var(--main-color);
    color: white;
    height: 50px;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    font-size: 20px;
    font-weight: bold;
}

.header-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: 50px;
    color: white;
    font-size: 14px;
    text-decoration: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

    .nav-link:hover {
        background-color: var(--main-hover);
    }

    .nav-link i {
        margin-right: 6px;
    }

/* ========== ドロップダウン ========== */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 4px 0;
    list-style: none;
}

    .dropdown-menu li a {
        display: block;
        padding: 8px 16px;
        text-decoration: none;
        color: #333;
        font-size: 13px;
        white-space: nowrap;
    }

        .dropdown-menu li a:hover {
            background-color: #f0f0f0;
        }

.nav-item.dropdown.open .dropdown-menu {
    display: block;
}

/* ========== レイアウト ========== */
#layout {
    display: flex;
    height: calc(100% - 50px);
}

#sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: white;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar-link {
    color: white;
    display: block;
    padding: 10px 0 10px 30px;
    font-size: 14px;
    text-decoration: none;
}

    .sidebar-link:hover {
        background-color: var(--main-hover);
    }

.sidebar-section {
    margin-top: 20px;
}

.sidebar-label {
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 13px;
    padding: 4px 0 0 30px;
}

.sidebar-divider-line {
    height: 1px;
    background-color: var(--accent-blue);
    margin: 6px 0 8px;
    width: calc(100% - 30px);
}

.sidebar-icon {
    margin-right: 6px;
}

.sidebar-divider {
    border-top: 1px solid #1cc88a;
    margin: 10px 0;
}

/* ========== メインコンテンツ ========== */
#main-content {
    flex-grow: 1;
    padding: 0;
    overflow-y: auto;
    background-color: var(--gray-light);
}

.page-inner {
    padding: 20px;
    box-sizing: border-box;
}

/* ========== カスタム要素 ========== */
.section-title {
    font-weight: 600;
    font-size: 24px;
    color: #6c757d;
    letter-spacing: -0.2px;
}

.accordion-button {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

.custom-btn {
    font-size: 12px !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
    font-weight: 500;
}

.custom-td {
    text-align: center !important;
    font-size: 12px !important;
}

    .custom-td input {
        text-align: left !important;
        font-size: 12px !important;
        padding: 2px 4px !important;
        height: auto;
    }

.custom-small-select {
    font-size: 11px !important;
    padding: 2px 6px !important;
    height: auto !important;
}

/* ========== ハイライト ========== */
.highlight-row,
tr.highlight-row td {
    background-color: #fff9c4 !important;
}

/* ========== テーブルヘッダー ========== */
thead.bg-dark th {
    background-color: #969A9E !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* 不要なセレクタ修正 */
head.bg-dark th {
    /* head はHTMLタグなので不要・誤り */
    display: none;
}



/* site.css の最後に追記 */
#global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    #global-loading-overlay .spinner-border {
        width: 3rem;
        height: 3rem;
    }




.color-box {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid #999;
    border-radius: 2px;
    flex-shrink: 0;
}

.status-label {
    font-size: 14px;
    white-space: nowrap;
}


.scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    position: relative;
}

/* テーブル全体 */
.project-table-custom {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 1200px;
    font-size: 0.85rem; /* 少し小さく */
    color: #212529;
}

    /* ヘッダー行 */
    .project-table-custom thead th {
        background-color: #969A9E; /* 落ち着いたグレー */
        color: white;
        font-weight: 600;
        text-align: center;
        padding: 6px 10px;
        border: 1px solid #dee2e6;
        white-space: nowrap;
        font-size: 11px;
    }

    /* 通常セル */
    .project-table-custom td {
        background-color: #fff;
        border: 1px solid #969A9E;
        padding: 6px 10px;
        white-space: nowrap;
        min-width: 120px;
    }

    /* Sticky列 */
    .project-table-custom .sticky-col {
        position: sticky;
        left: 0;
        background-color: #969A9E;
        color: white;
        z-index: 2;
        font-weight: 600;
        min-width: 120px;
    }

    /* Sticky列（thead専用） */
    .project-table-custom thead .sticky-col {
        z-index: 3;
    }

    /* Sticky列 */
    .project-table-custom .sticky-col-td {
        position: sticky;
        left: 0;
        background-color: #fff;
        color: darkgray;
        z-index: 2;
        font-weight: 600;
        min-width: 120px;
        font-size: 11px;
    }


    /* 高さと揃え */
    .project-table-custom th,
    .project-table-custom td {
        vertical-align: middle;
    }

    /* 行・列もrelativeにすることでstickyの親を明示 */
    .project-table-custom thead,
    .project-table-custom tbody,
    .project-table-custom tr {
        position: relative;
    }








/* 共通のセレクトボックス */
.custom-select-sm {
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #212529;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-width: 120px;
    max-width: 200px;
}

    /* フォーカス時やホバー時の見た目 */
    .custom-select-sm:focus,
    .custom-select-sm:hover {
        background-color: #e9ecef;
        border-color: #6c757d;
        outline: none;
    }

    /* 選択肢ドロップダウン全体のカスタム（必要に応じて） */
    .custom-select-sm option {
        background-color: #ffffff;
        color: #212529;
    }







.custom-select-counter {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    padding: 4px 12px;
    font-size: 0.875rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1em;
    color: #000;
    outline: none;
}

    /* セレクト要素に擬似矢印（要らなければ消してOK） */
    .custom-select-counter::after {
        content: "";
        display: none;
    }

/* オプション項目の色は style 属性で制御されるのでOK */
