﻿/* #region ----------【核心色系定義 (CSS Variables)】---------- */
:root {
    --eip-blue: #42A5F5; /* 藍色主要 */
    --eip-blue-hover: #1E88E5;
    --eip-red: #EF9A9A; /* 紅色刪除/警告 */
    --eip-red-hover: #EF5350;
    --eip-yellow: #FFC107; /* 黃色注意 (校正為更明亮的警告黃) */
    --eip-yellow-hover: #b57f00;
    --eip-green: #81C784; /* 綠色成功 */
    --eip-green-hover: #009688;
    --eip-gray: #DCDCDC; /* 一般主要/灰色 */
    --eip-gray-hover: #CFCFCF;
    --eip-disable-bg: #EEEEEE; /* 禁用背景 */
    --eip-disable-text: #AAAAAA;
}
/* #endregion */

body {
}
/* --- 1. 容器：將原本的 fixed 限制在 main-content 的範圍內 --- */
.tabs-container {
    width: 100%; /* 保持原樣 */
    display: flex;
    flex-direction: column;
    /* 核心修改：高度改為填滿 main-content，避免寫死 952px */
    height: calc(100vh - 60px);
    position: relative; /* 移除 fixed，改用 relative 以支援 sidebar 拉伸 */
    overflow: hidden; /* 確保捲軸出現在內容區，而不是容器外 */
}

/* --- 2. 標籤列：移除 position: absolute --- */
.tab-header {
    background-color: #ffffff;
    border-bottom: 1px solid #ccc;
    flex-shrink: 0; /* 確保標籤列不會被擠壓消失 */
    display: flex; /* 改用 flex 排列 tab-link */
    width: 100%;
}

/* --- 3. 標籤按鈕：完全保留你的樣式與彩色效果 --- */
.tab-link {
    background-color: inherit;
    /* float: left; */ /* 改用 flex 後不需 float，但保留也不影響 */
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 18px;
    font-weight: 500;
    height: 53px;
    display: flex;
    align-items: center;
    color: #696969; /* 原始灰色 */
}

    .tab-link:hover {
        background-color: #64B5F6;
        color: #Fff;
    }

    .tab-link.active {
        background-color: #fff;
        border-bottom: 2px solid #64B5F6;
        color: #64B5F6;
        font-weight: bold;
        height: 53px;
    }

.tab-icon {
    padding: 0 10px;
    display: flex;
}

/* --- 4. 內容區塊：解決 Tab2 (120vh) 導致的遮擋問題 --- */
.tab-content {
    /* display 由你的 JS 控制 (block/none) */
    padding: 20px;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    animation: fadeIn 0.5s;
    /* 核心修改：讓內容區自己長捲軸 */
    flex: 1; /* 自動填滿標籤列以下的空間 */
    overflow-y: auto; /* 垂直捲軸 */
    overflow-x: auto; /* 支援寬 Table 的橫向捲軸 */
    min-height: 0; /* 讓 flex 捲軸生效的關鍵 */
    /* 移除以下造成定位衝突的屬性 */
    /* position: relative; */
    /* top: 50px;          */
    /* height: 90vh;       */
}

/* 淡入淡出 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* #region ----------【Text Color】----------  */
.text-color {
    color: #444;
}

.text-color-blue {
    color: #42A5F5;
}

.text-color-rad {
    color: #EF5350;
}

.text-color-yellow {
    color: #faad14;
}

.text-color-green {
    color: #66BB6A;
}
/* 覆蓋 Flatpickr 樣式以符合你的色調 */
.flatpickr-calendar {
    border-radius: 10px 10px 0 0;
}
.flatpickr-day.selected {
    background: #42A5F5 !important; /* text-color-blue */
    border-color: #42A5F5 !important;
}

.flatpickr-day.today {
    border-color: #EF5350 !important; /* text-color-rad */
}

.flatpickr-day:hover {
    background: #64b5f6 !important; /* text-color-yellow */
    border-color: #64b5f6 !important;
    color: white;
}

.flatpickr-time input:focus {
    background: #64b5f63b; /* text-color-green alpha */
}

.flatpickr-months .flatpickr-month {
    color: #444;
    fill: #444;
    border-radius: 10px 10px 0 0;
    background: #e9ddff;
}

/* #endregion */


/* #region ----------【Buttons】----------  */
.btn-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--eip-gray);
    color: #444;
}

    .btn-custom svg {
        width: 18px;
        height: 18px;
        stroke: currentColor;
    }

/* 顏色更換區 */
.btn-blue {
    background-color: var(--eip-blue);
    color: #ffffff;
}

    .btn-blue:hover {
        background-color: var(--eip-blue-hover);
        color: #ffffff;
    }

.btn-red {
    background-color: var(--eip-red);
    color: #ffffff;
}

    .btn-red:hover {
        background-color: var(--eip-red-hover);
        color: #ffffff;
    }

.btn-yellow {
    background-color: var(--eip-yellow);
    color: #583e00;
}

    .btn-yellow:hover {
        background-color: var(--eip-yellow-hover);
        color: #ffffff;
    }

.btn-green {
    background-color: var(--eip-green);
    color: #006259;
}

    .btn-green:hover {
        background-color: var(--eip-green-hover);
        color: #ffffff;
    }

.btn-custom:active {
    transform: scale(0.96);
}

.btn-disable {
    background-color: var(--eip-disable-bg);
    color: var(--eip-disable-text);
    opacity: 0.7;
    cursor: not-allowed !important;
    pointer-events: auto;
}

    .btn-disable * {
        cursor: not-allowed;
    }
/* #endregion */
/* #region ---------【CheckBox & RadioButton】---------  */
/* 容器樣式 */
.custom-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    margin-right: 15px;
    gap: 8px;
    color: #333;
}

    /* 隱藏原始 Checkbox */
    .custom-checkbox input {
        display: none;
    }

/* 自定義方框基礎樣式 */
.checkmark {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid #d1d1d1;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

/* 滑鼠懸停時的邊框顏色 */
.custom-checkbox:hover input ~ .checkmark {
    border-color: #42A5F5;
}

/* 當勾選時的樣式 (藍色底) */
.custom-checkbox input:checked ~ .checkmark {
    background-color: #42A5F5;
    border-color: #42A5F5;
}

/* 勾選時的白色打勾符號 */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 顯示打勾符號 */
.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

/* --- 禁用狀態 (Disabled) --- */

.custom-checkbox.disabled {
    cursor: not-allowed; /* 標籤文字也會顯示禁止符號 */
    color: #aaa;
}

.custom-checkbox input:disabled ~ .checkmark {
    background-color: #f5f5f5;
    border-color: #ddd;
    cursor: not-allowed; /* 方框也顯示禁止符號 */
}

/* 禁用且勾選時的樣式 (變灰色底) */
.custom-checkbox input:disabled:checked ~ .checkmark {
    background-color: #ccc;
    border-color: #ccc;
}
/* 容器樣式 */
.custom-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
    margin-right: 20px;
    gap: 8px;
    color: #333;
    user-select: none;
}

    /* 隱藏原始 Radio */
    .custom-radio input {
        display: none;
    }

/* 自定義圓圈基礎樣式 */
.radiomark {
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 2px solid #d1d1d1;
    border-radius: 50%; /* 圓形關鍵 */
    position: relative;
    transition: all 0.2s ease;
}

/* 懸停效果 */
.custom-radio:hover input ~ .radiomark {
    border-color: #007bff;
}

/* 選中時的樣式 (藍色邊框) */
.custom-radio input:checked ~ .radiomark {
    border-color: #42A5F5;
}

/* 選中時內部的實心圓點 */
.radiomark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #42A5F5;
    transform: translate(-50%, -50%); /* 置中 */
}

/* 顯示圓點 */
.custom-radio input:checked ~ .radiomark:after {
    display: block;
}

/* --- 禁用狀態 (Disabled) --- */

.custom-radio.disabled {
    cursor: not-allowed !important; /* 確保文字也出現禁止符號 */
    color: #aaa;
}

    /* 關鍵：移除 pointer-events 以確保出現禁止符號 */
    .custom-radio.disabled input {
        pointer-events: auto;
    }

.custom-radio input:disabled ~ .radiomark {
    background-color: #f5f5f5;
    border-color: #ddd;
    cursor: not-allowed;
}

/* 禁用且選中時的中心圓點變灰色 */
.custom-radio input:disabled:checked ~ .radiomark:after {
    background: #ccc;
}
/* #endregion  */

/* #region ----------【Selector】----------  */
/* 進用選單的 CSS */
.custom-select:disabled {
    background-color: #f5f5f5;
    color: #aaaaaa;
    cursor: not-allowed !important; /* 確保禁止符號出現 */
    border-color: #dddddd;
}
/* 1. 容器：必須是 relative，箭頭才能精準定位 */
.select-wrapper {
    width: 250px;
    margin-bottom: 20px;
    padding: 0 20px;
    position: relative; /* 確保箭頭以這個框為基準 */
    display: flex;
    flex-direction: column;
}

    .select-wrapper label {
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
        color: #666;
    }

/* 2. 下拉選單本體 */
.custom-select {
    width: 100%;
    padding: 10px 15px;
    padding-right: 35px; /* 重要：留空間給 V 字箭頭，防止文字重疊 */
    font-size: 14px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    background-color: #fff;
    /* 核心：徹底關閉瀏覽器原生樣式 */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s;
    cursor: pointer;
    height: 40px;
}

/* 3. 自定義 V 字型箭頭 (仿照你提供圖中的細線感) */
.select-wrapper::after {
    content: "";
    position: absolute;
    right: 35px; /* 距離右側的距離 */
    top: 38px; /* 垂直位置：需根據你的 Label 高度手動微調 */
    /* 畫出 V 字 */
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #666; /* 線條粗細與顏色 */
    border-bottom: 1.5px solid #666;
    /* 旋轉成 V 字型 */
    transform: rotate(45deg);
    /* 防止箭頭擋住滑鼠點擊 select 框 */
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* 4. 狀態處理 */
.custom-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 禁用狀態時隱藏箭頭或變色 */
.custom-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}
/* 讓 Input 組合變成相對定位 */
.search-input-group {
    position: relative;
    width: 100%;
}

/* 自定義下拉清單外殼 */
.custom-search-options {
    display: none; /* 預設隱藏 */
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px dashed #00c2ff; /* 仿圖中的藍色虛線 */
    border-radius: 4px;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 下拉選項項目 */
.search-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

    .search-item:hover {
        background-color: #f0f7ff; /* 淺藍色 Hover */
        color: #007bff;
    }

.no-result {
    color: #999;
    cursor: default;
}
/* 針對 Chrome, Safari, Edge 消除 datalist 的預設下拉箭頭 */
.custom-select::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none;
}

/* 確保搜尋選單的 input 在 focus 或 hover 時不會跑出多餘圖示 */
input[list].custom-select::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0;
}

/* 基礎排版 */
.content-padding {
    padding: 20px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

/* 多選選單核心樣式 */
.ms-container {
    width: 350px;
    position: relative;
}

.ms-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

.required {
    color: red;
}

.ms-select-box {
    position: relative;
}

.ms-trigger {
    padding: 10px 15px;
    border-radius: 4px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #d1d1d1;
    appearance: none;
    -webkit-appearance: none;
    background-position: right 15px center;
    background-size: 16px;
    transition: border-color 0.2s;
    cursor: pointer;
    height: 40px;
}

/* 修改後的 ms-arrow */
.ms-arrow {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #888888;
    border-bottom: 1.5px solid #888888;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 5px;
    display: inline-block;
}

/* 當選單開啟時（.active），箭頭可以轉向朝上 */
.active .ms-arrow {
    transform: rotate(-135deg);
    margin-top: 5px; /* 旋轉後微調位置 */
}

/* 下拉浮層：不推擠內容的關鍵 */
.ms-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px dashed #00c2ff; /* 藍色虛線框 */
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: 2px;
    font-size: 14px;
}

    .ms-options.show {
        display: block;
    }

.ms-option-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
}

    .ms-option-item:hover {
        background: #f5faff;
    }

.ms-divider {
    height: 1px;
    background: #eee;
}

/* 自定義勾選框 */
.ms-option-item input {
    display: none;
}

.ms-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #42A5F5;
    border-radius: 2px;
    margin-right: 12px;
    position: relative;
}

.ms-option-item input:checked + .ms-checkbox {
    background: #42A5F5;
}

    .ms-option-item input:checked + .ms-checkbox::after {
        content: '';
        position: absolute;
        left: 5px;
        top: 1px;
        width: 4px;
        height: 8px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }
/* 讓選單與預覽區橫向排列 */
.ms-flex-layout {
    display: flex;
    gap: 30px;
    /*align-items: flex-start;*/
    align-items: center;
    flex-wrap: wrap;
}

/* 預覽區域樣式 */
.ms-preview-area {
    flex: 1;
    min-width: 200px;
}

.ms-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    min-height: 40px;
    font-size: 14px;
}

/* 預覽標籤樣式 */
.ms-tag {
    background: #eef6ff;
    color: #007bff;
    border: 1px solid #cce5ff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.no-data {
    color: #bbb;
    font-size: 13px;
    line-height: 24px;
}
/*  #endregion */

/* #region ----------【Input】----------  */
/* 基礎容器：承襲 select-wrapper 的排版，但不含箭頭 */
.input-wrapper {
    width: 250px;
    margin-bottom: 20px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

    .input-wrapper label {
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
        color: #666;
    }

/* 通用輸入框基礎樣式 */
.custom-input {
    width: 100%;
    height: 40px;
    padding: 10px 15px;
    font-size: 14px;
    /* border: 1px solid #d1d1d1; */
    /* border-radius: 6px; */
    /* background-color: #fff; */
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    border-top: none;
    border-left: none;
    border-right: none;
}

    /* --- 狀態 1：Focus (藍色) --- */
    .custom-input:focus {
        border-color: #007bff;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

    /* --- 狀態 2：警告 (紅框) --- */
    .custom-input.input-error {
        border-color: #d93025;
        background-color: #fff8f8;
    }

        .custom-input.input-error:focus {
            box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.1);
        }

.error-text {
    color: #d93025;
    font-size: 12px;
    font-weight: normal;
}

/* --- 狀態 3：唯讀 (Readonly) --- */
/* 保持白底但調整邊框與游標，不顯示 Focus 藍框 */
.custom-input[readonly] {
    background-color: #fafafa;
    border-color: #e0e0e0;
    cursor: default;
}

    .custom-input[readonly]:focus {
        border-color: #e0e0e0;
        box-shadow: none;
    }

/* --- 狀態 4：進用 (Disabled) --- */
.custom-input:disabled {
    background-color: #f5f5f5;
    border-color: #d1d1d1;
    color: #999;
    cursor: not-allowed;
}
/* 上傳區域基礎樣式 */
.upload-area {
    width: 100%;
    height: 150px;
    border: 2px dashed #d1d1d1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
    color: #666;
    gap: 10px;
}

    .upload-area:hover {
        border-color: #42A5F5;
        background-color: #f0f7ff;
        color: #42A5F5;
    }

    .upload-area svg {
        width: 40px;
        height: 40px;
        stroke: #aaa;
        transition: stroke 0.3s;
    }

    .upload-area:hover svg {
        stroke: #42A5F5;
    }

/* 預覽圖片樣式 */
.preview-container {
    position: relative;
    margin-top: 15px;
    width: fit-content;
}

    .preview-container img {
        max-width: 200px;
        max-height: 200px;
        border-radius: 6px;
        border: 1px solid #ddd;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

/* 刪除按鈕 (紅) */
.remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #EF5350;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
/* #endregion */

.upload-file-btn {
    padding: 0 10px;
    display: inline-block;
    transform: rotate(45deg);
    cursor: pointer;
    transition: 0.3s ease all;
}
    .upload-file-btn:hover {
        /* 同時寫在一起：旋轉 45 度 並且 放大 1.5 倍 */
        transform: rotate(45deg) scale(1.5);
        transition: 0.3s ease all;
    }

.gd {
    display: grid;
}

.knob,
.btn-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.btn {
    position: relative;
    top: 50%;
    width: 74px;
    height: 36px;
    margin: -20px auto 0 auto;
    overflow: hidden;
}

    .btn.btn-pill,
    .btn.btn-pill > .btn-bg {
        border-radius: 100px;
    }

    .btn.btn-rect {
        border-radius: 2px;
    }

.switch-checkbox {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.knob {
    z-index: 2;
}

.btn-bg {
    width: 100%;
    background-color: #ebf7fc;
    transition: 0.3s ease all;
    z-index: 1;
}


/* Button 3 */
#button-3 .knob:before {
    content: "YES";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 25px;
    height: 25px;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    padding: 9px 4px;
    background-color: #42A5F5;
    border-radius: 50%;
    transition: 0.3s ease all, left 0.3s cubic-bezier(0.18, 0.89, 0.35, 1.15);
}

#button-3 .switch-checkbox:active + .knob:before {
    width: 46px;
    border-radius: 100px;
}

#button-3 .switch-checkbox:checked:active + .knob:before {
    margin-left: -26px;
}

#button-3 .switch-checkbox:checked + .knob:before {
    content: "NO";
    left: 42px;
    background-color: #ef9a9a;
}

#button-3 .switch-checkbox:checked ~ .btn-bg {
    background-color: #fcebeb;
}




/* #region ----------【Loading】----------  */

/* 骨架屏基礎容器 */
.skeleton-card {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
}

/* 掃掠光影的核心動畫 */
.skeleton-avatar, .skeleton-line {
    background: #eee;
    background-image: linear-gradient( 90deg, #eee 0px, #f5f5f5 40px, #eee 80px );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    height: 30px;
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }

    100% {
        background-position: 100% 0;
    }
}

/* 佈局組件 */
.skeleton-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.skeleton-meta {
    flex: 1;
}

.skeleton-line {
    height: 25px;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* 控制寬度 */
.short {
    width: 40%;
}

.x-short {
    width: 20%;
    height: 8px;
}

.medium {
    width: 70%;
}

/* #endregion */


/* =========================
   出退勤
========================= */
.clockout-btn {
    height: 300px;
    width: 40%;
    border: none;
    color: #fff;
    /* background: #83bf95; */
    font-size: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .clockout-btn:hover {
        transform: scale(1.05); /* 👈 放大 5% */
    }