.manager-content {
    padding-top: 15px;
    margin-top: 65px;
}

.header-a {
    color: #000;
}

.header-a.active {
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
}

.program-week {
    justify-content: center;
    padding: 0 1%;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    list-style: none;
}

.program-week .nav-item {
    width: 90%;
    text-align: center;
}

.program-week .nav-link.active,
.program-week .nav-item.show .nav-link {
    color: #35bea2;
}

.program-week a {
    color: #707070;
}
.wrapper {
    display: flex;
    align-items: stretch;
    perspective: 1500px;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: #e6e6e6;
    color: #0000;
    transition: all 0.6s cubic-bezier(0.945, 0.02, 0.27, 0.665);
    transform-origin: center left; /* Set the transformed position of sidebar to center left side. */
    margin-left: -250px;
    transform: rotateY(100deg);
}

/* #sidebar.active {
    margin-left: -250px;
    transform: rotateY(100deg); /* Rotate sidebar vertically by 100 degrees. 
} */
#sidebar.active {
    margin-left: 0;
    transform: none;
}
@media (max-width: 768px) {
    /*
    #sidebar {
        margin-left: -250px;
        transform: rotateY(100deg);
    }
    #sidebar.active {
        margin-left: 0;
        transform: none;
    }
*/
    /* Reversing the behavior of the bars: 
       Removing the rotation from the first,
       last bars and reappear the second bar on default state, 
       and giving them a vertical margin */
    #sidebarCollapse span:first-of-type,
    #sidebarCollapse span:nth-of-type(2),
    #sidebarCollapse span:last-of-type {
        transform: none;
        opacity: 1;
        margin: 5px auto;
    }

    /* Removing the vertical margin and make the first and last bars rotate again when the sidebar is open, hiding the second bar */
    #sidebarCollapse.active span {
        margin: 0 auto;
    }
    #sidebarCollapse.active span:first-of-type {
        transform: rotate(45deg) translate(2px, 2px);
    }
    #sidebarCollapse.active span:nth-of-type(2) {
        opacity: 0;
    }
    #sidebarCollapse.active span:last-of-type {
        transform: rotate(-45deg) translate(1px, -1px);
    }
}

.navbar-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: rgba(0, 0, 0, 0.45);
    margin: auto;
    margin-bottom: 4px;
    transition: all 400ms linear;
    cursor: pointer;
}

.navbar-collapse {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    height: 100vh;
    overflow-y: scroll;
    background-color: #fff;
    z-index: 101;
}
.navbar-collapse .header-a {
    padding-left: 15px;
    padding-right: 15px;
    margin-top: 10px;
    border-bottom: solid 1px #afafaf;
}

.navbar-collapse .header-a.active {
    border-bottom: solid 1px #1a73e8;
}

.navbar-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
}
.navbar-toggle {
    position: relative;
    float: right;
    padding: 9px 10px;
    margin-top: 8px;
    margin-right: 15px;
    margin-bottom: 8px;
    background-color: transparent;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
}
.navbar-toggle[aria-expanded="false"] span:nth-child(2) {
    opacity: 1;
}
.navbar-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.navbar-toggle[aria-expanded="true"] span:first-child {
    transform: rotate(-45deg);
    position: relative;
    top: 7.5px;
}
.navbar-toggle[aria-expanded="true"] span:last-child {
    transform: rotate(45deg);
    position: relative;
    bottom: 6px;
}

/*  */
.header-func-area {
    flex: 1;
}

.modal {
    overflow-y: auto;
}

/* Important part */
.modal-dialog {
    overflow-y: initial !important;
}
.modal-body {
    height: 70vh;
    overflow-y: auto;
}

.flex-height {
    height: 400px;
    overflow-y: auto;
}

img {
    width: 100%;
}

.search-area {
    margin-bottom: 10px;
}

.search-area > div {
    margin-bottom: 5px;
}

.form-content > div {
    margin-bottom: 5px;
}

.form-content div.form-hr {
    width: 100%;
    border-bottom: 1px solid #7070704b;
    margin: 30px 0 0;
}

.form-content .form-hr-narrow {
    width: 100%;
    border-bottom: 1px solid #7070704b;
    margin: 10px 5px 10px;
}

.form-content .form-group {
    padding: 0;
    display: flex;
}
.form-content .form-group div {
    display: inline;
}

.form-content .form-group div:first-child {
    padding-right: 5px;
}

.form-content .form-group div:last-child {
    padding-left: 5px;
}

button:disabled {
    cursor: not-allowed;
    background-color: #e9ecef !important;
}

/* 案件合約 modal_contract */
.contract-fee-block {
    padding: 10px;
    border: #afafaf solid 1px;
}

.contract-total {
    padding-left: 20px;
}

/* 執行單位 modal_section */
.event-section-block {
    padding: 10px;
    border: #afafaf solid 1px;
}

.event-section-block:nth-of-type(odd) {
    background-color: #ff000034;
}
.event-section-block:nth-of-type(even) {
    background-color: #e5ff007c;
}

.event-section-company-block {
    padding: 10px;
    border: #afafaf solid 1px;
    background-color: #fff;
}

.add_section_company_block {
    margin-top: 10px;
}

/* 搜尋區塊樣式 */
.search-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 區塊標題樣式 */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* 表單元素樣式 */
.form-group {
    margin-bottom: 0;
}

.form-control {
    border-radius: 0.25rem;
    height: 2.5rem;
    padding: 0.375rem 0.75rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-control[type="color"] {
    width: revert;
}

/* 日期區間組樣式 */
.date-range-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-group .form-control {
    flex: 1;
}

.date-separator {
    color: #6c757d;
    font-weight: 500;
    padding: 0 5px;
}

/* 按鈕群組樣式 */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group .btn {
    padding: 0.5rem 1.5rem;
}

/* 進階搜尋區域動畫 */
.advanced-search-area {
    transition: all 0.3s ease-in-out;
}

/* 進階搜尋內容區域 */
.advanced-search-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* RWD 適配 */
@media (max-width: 768px) {
    .button-group {
        margin-top: 15px;
    }

    .button-group .btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .date-range-group {
        flex-direction: column;
        gap: 5px;
    }

    .date-separator {
        align-self: center;
    }
}

/* Modal 樣式優化 */
.modal-xl {
    max-width: 95%;
    margin: 1.75rem auto;
}

/* 表格響應式設計 */
@media (max-width: 768px) {
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* 按鈕組樣式 */
.table-function-btn {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* 狀態標籤樣式 */
.badge {
    padding: 0.4em 0.6em;
    font-size: 85%;
}

/* 搜尋區域樣式 */
.tool-bar {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* 設定管理按鈕樣式 */
.manage-btn {
    color: #666;
    font-size: 16px;
    transition: all 0.2s;
}

/* 修正搜索輸入框寬度 */
.select2-container-multi
    .select2-choices
    .select2-search-field
    input.select2-input,
.select2-search__field {
    width: 100% !important;
    min-width: 200px !important;
}

/* select2 下拉選單寬度 */
.select2-drop {
    min-width: 200px !important; /* 您想要的下拉選單寬度 */
}

/* select2 隱藏選取值 */
.select2-chosen-hidden .select2-chosen {
    display: none !important;
}

/* 權限管理樣式 */
.permission-container {
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.permission-select-all {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.permission-group {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.permission-group-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

.permission-group-items {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.permission-item {
    padding: 5px 0;
}

.disabled-permissions {
    opacity: 0.7;
    pointer-events: none;
}

.disabled-permissions input[type="checkbox"] {
    cursor: not-allowed;
}

/* Modal */

.row.form-content .btn {
    padding: 5px;
    border-radius: 0;
    margin: 0 5px;
    transition: all 0.3s ease;
    height: 40px;
}

.row.form-content .btn-check:checked + .btn {
    background-color: #4169e1;
    color: white;
    border-color: #4169e1;
}

.row.form-content .btn i {
    font-size: 1.2em;
    margin-right: 8px;
}

.row.form-content .btn-outline-primary {
    border-width: 2px;
}

.row.form-content .btn-outline-primary:hover {
    background-color: #4169e1;
    color: white;
}

.row.form-content .input-group-text {
    background-color: #f8f9fa;
}
.row.form-content .input-group-text.prepend {
    border-right: none;
}
.row.form-content .input-group-text.append {
    border-left: none;
}

.row.form-content .input-group .form-control:focus {
    box-shadow: none;
}

.row.form-content h5 {
    font-size: 1.2em;
    color: #4169e1;
}

.row.form-content .info-section {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}

/* 按鈕基本樣式 */
.state-filter-buttons {
    padding: 0;
}

.state-filter-buttons .btn {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    background: white;
}

/* 按鈕顏色設定 - 由灰色開始，接著藍色漸深 */
.state-filter-buttons .btn:nth-child(1) {
    border: 1.5px solid #6b7280;
    color: #6b7280;
}

.state-filter-buttons .btn:nth-child(2) {
    border: 1.5px solid #93c5fd;
    color: #93c5fd;
}

.state-filter-buttons .btn:nth-child(3) {
    border: 1.5px solid #60a5fa;
    color: #60a5fa;
}

.state-filter-buttons .btn:nth-child(4) {
    border: 1.5px solid #3b82f6;
    color: #3b82f6;
}

.state-filter-buttons .btn:nth-child(5) {
    border: 1.5px solid #2563eb;
    color: #2563eb;
}

.state-filter-buttons .btn:nth-child(6) {
    border: 1.5px solid #1d4ed8;
    color: #1d4ed8;
}

.state-filter-buttons .btn:nth-child(7) {
    border: 1.5px solid #1e40af;
    color: #1e40af;
}

.state-filter-buttons .btn:nth-child(8) {
    border: 1.5px solid #1e3a8a;
    color: #1e3a8a;
}

.state-filter-buttons .btn:nth-child(9) {
    border: 1.5px solid #172554;
    color: #172554;
}

.state-filter-buttons .btn:nth-child(10) {
    border: 1.5px solid #0f172a;
    color: #0f172a;
}

/* Hover 狀態 */
.state-filter-buttons .btn:nth-child(1):hover {
    background: rgba(107, 114, 128, 0.1);
}

.state-filter-buttons .btn:nth-child(2):hover {
    background: rgba(147, 197, 253, 0.1);
}

.state-filter-buttons .btn:nth-child(3):hover {
    background: rgba(96, 165, 250, 0.1);
}

.state-filter-buttons .btn:nth-child(4):hover {
    background: rgba(59, 130, 246, 0.1);
}

.state-filter-buttons .btn:nth-child(5):hover {
    background: rgba(37, 99, 235, 0.1);
}

.state-filter-buttons .btn:nth-child(6):hover {
    background: rgba(29, 78, 216, 0.1);
}

.state-filter-buttons .btn:nth-child(7):hover {
    background: rgba(30, 64, 175, 0.1);
}

.state-filter-buttons .btn:nth-child(8):hover {
    background: rgba(30, 58, 138, 0.1);
}

.state-filter-buttons .btn:nth-child(9):hover {
    background: rgba(23, 37, 84, 0.1);
}

.state-filter-buttons .btn:nth-child(10):hover {
    background: rgba(15, 23, 42, 0.1);
}

/* Active 狀態 */
.state-filter-buttons .btn:nth-child(1).active {
    background: #6b7280;
    color: white;
}

.state-filter-buttons .btn:nth-child(2).active {
    background: #93c5fd;
    color: white;
}

.state-filter-buttons .btn:nth-child(3).active {
    background: #60a5fa;
    color: white;
}

.state-filter-buttons .btn:nth-child(4).active {
    background: #3b82f6;
    color: white;
}

.state-filter-buttons .btn:nth-child(5).active {
    background: #2563eb;
    color: white;
}

.state-filter-buttons .btn:nth-child(6).active {
    background: #1d4ed8;
    color: white;
}

.state-filter-buttons .btn:nth-child(7).active {
    background: #1e40af;
    color: white;
}

.state-filter-buttons .btn:nth-child(8).active {
    background: #1e3a8a;
    color: white;
}

.state-filter-buttons .btn:nth-child(9).active {
    background: #172554;
    color: white;
}

.state-filter-buttons .btn:nth-child(10).active {
    background: #0f172a;
    color: white;
}

/* Badge 樣式 */
.state-filter-buttons .badge {
    font-size: 13px;
    padding: 3px 6px;
    border-radius: 50%;
    margin-left: 8px !important;
    font-weight: normal;
}

/* 一般狀態的 Badge */
.state-filter-buttons .btn .badge {
    background: rgba(0, 0, 0, 0.1);
    color: white;
}

/* Active 狀態的 Badge */
.state-filter-buttons .btn.active .badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 5. 狀態徽章
-------------------------------------------------- */
.card .badge {
    padding: 0.5em 1em;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
}

.badge-secondary {
    background-color: #718096;
    color: white;
}
.badge-warning {
    background-color: #ff8b00;
    color: white;
}
.badge-info {
    background-color: #63b3ed;
    color: white;
}
.badge-success {
    background-color: #68d391;
    color: white;
}
.badge-danger {
    background-color: #ff0000;
    color: white;
}

/* disabled 按鈕群組樣式 */
.btn-group .btn[for$="disabled"] {
    cursor: not-allowed;
    opacity: 0.65;
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
}

/* disabled 狀態下的按鈕 hover 效果 */
.btn-group .btn-outline-dark:disabled,
.btn-group .btn-outline-dark[disabled],
.btn-group input[type="radio"]:disabled + .btn-outline-dark {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    pointer-events: none;
}

/* 確保disabled狀態下的按鈕不會有hover效果 */
.btn-group .btn-outline-dark:disabled:hover,
.btn-group .btn-outline-dark[disabled]:hover,
.btn-group input[type="radio"]:disabled + .btn-outline-dark:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
}

/* 選中狀態的disabled按鈕 */
.btn-group input[type="radio"]:checked:disabled + .btn-outline-dark,
.btn-group input[type="radio"]:checked[disabled] + .btn-outline-dark {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
    opacity: 0.65;
}

.swal2-popup {
    z-index: 9999 !important;
}

.swal2-container {
    z-index: 9999 !important;
}

/* 罐頭訊息 */
.canned-message-btn {
    border-radius: 14px !important;
    padding: 5px 10px !important;
}

/* 其他文字 */
.other-input input {
    height: 24px;
    font-size: 12px;
    text-align: center;
}

/* 數字切換 */
.number-spinner::-webkit-inner-spin-button,
.number-spinner::-webkit-outer-spin-button {
    opacity: 1;
}

.compact-input {
    width: 45px;
    height: 24px;
    padding: 2px 4px;
    font-size: 12px;
    text-align: center;
}

.input-wrap small {
    font-size: 12px;
    color: #666;
}

/* 客戶資料 */
.info-scroll-container {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px; /* 為卷軸預留空間 */
}

/* 自訂卷軸樣式 */
.info-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.info-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.info-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.info-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.info-scroll-content {
    min-width: min-content; /* 確保內容不會被擠壓 */
}

.customer-info-item {
    margin-right: 2px; /* 欄位間的間距 */
    display: inline-block;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 20%;
    max-width: 200px; /* 設定最大寬度 */
    overflow: hidden;
    position: relative;
}

.customer-info-item input,
.customer-info-item select,
.customer-info-item .select2-container {
    max-height: 2.5rem;
    height: 2.5rem;
    overflow-y: hidden; /* 隱藏Y軸滾軸 */

}

.customer-info-item .select2-container .select2-choices {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: scroll; /* 隱藏X軸滾軸 */
    white-space: nowrap;
    width: 100%;
}

.select2-container .select2-choice {
    display: block;
    height: 30px;
}

/* Table th btn */
.dropdown-toggle::after {
    vertical-align: 0.2em;
}
.dropdown-menu {
    min-width: 5rem;
    padding: 0.2rem 0;
}
.dropdown-item {
    padding: 0.25rem 1rem;
    font-size: 0.875rem;
}

/* Tooltip */
.tooltip-inner {
    max-width: none;
    width: auto;
    white-space: pre-line;
    text-align: left;
    padding: 8px 12px; /* 加大內距 */
    line-height: 1.5; /* 調整行高 */
}

/* 隱藏所有 number input 的箭頭 */
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
    -webkit-appearance: textfield; /* Safari & Chrome */
    appearance: textfield;
}

/* 隱藏 Webkit 瀏覽器（Chrome、Safari、Edge）的箭頭 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-check-label {
    transform: translateY(-2px);
}

.customer-info-item {
    flex: 1;
}
