.draggable {
    /* padding: 4px 6px; */
    background-color: #ccc;
    cursor: grab;
    border: 1px solid #999;
    border-radius: 4px;
    user-select: none;
    font-size: 10px;
    width: 120px;
    display: inline-block;
    text-align: center;
    margin: 2px;
    word-wrap: break-word;
    white-space: normal;
}

.task-bar {
    transition: width 0.3s ease;
}

.status-critical {
    background-color: rgba(220, 53, 69, 0.5);
    border: 2px solid rgba(220, 53, 69, 0.5);
}

.status-caution {
    background-color: rgba(255, 193, 7, 0.5);
    border: 2px solid rgba(255, 193, 7, 0.5);
}

.status-safe {
    background-color: rgba(40, 167, 69, 0.5);
    border: 2px solid rgba(40, 167, 69, 0.5);
}

.placed {
    all: unset;
    /* 清除預設或繼承的表格樣式 */
    background-color: #ccc;
    border: 1px solid #999;
    /* 移除背景與邊框 */
    /* background-color: transparent;
    border: none; */
    border-radius: 3px;
    user-select: none;
    font-size: 10px;
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
    cursor: grab;
    box-sizing: border-box;
}


.schedule-table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid #aaa !important;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    font-size: 12px;
    width: 80px;
    max-width: 80px;
    min-width: 80px;
}

.schedule-table th {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
    height: 36px;
}

.schedule-table td:not(:first-child) {
    min-height: 48px;
    height: 48px;
}

.droppable {
    background-color: #f9f9f9;
}

.droppable:hover {
    background-color: #dfefff;
}

.blocked {
    background-color: #dff0ea !important;
    pointer-events: none;
    font-weight: bold;
    color: #444;
}

.DatePickerSingle input {
    width: 160px !important;
    font-size: 14px;
}

.SingleDatePicker_picker {
    z-index: 9999 !important;
}

/* 強制 DatePickerRange 的彈出日曆浮到最上層 */
.DateRangePicker_picker {
    z-index: 9999 !important;
}

/* 改變 DatePickerRange 的上方小箭頭顏色 */
.DateRangePicker_picker__triangle {
    border-bottom-color: #007bff !important;
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 130px);
    gap: 1px;
    width: 100%;
    margin-top: 12px;
}

.task-grid .draggable {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-tag {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    font-weight: bold;
    color: #004085;
    z-index: 3;
}

.safe-tag {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    font-weight: bold;
    color: #155724;
    z-index: 3;
}

/* Lock button floating in top-right corner */
.lock-button {
    position: absolute;
    /* 改為 absolute */
    top: 12px;
    right: 12px;
    z-index: 999;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #dc3545;
    /* red when locked */
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}


.lock-button:hover {
    transform: scale(1.05);
}

/* Style when unlocked (you’ll toggle this via JS) */
.lock-button.unlocked {
    background-color: #28a745;
    /* green when unlocked */
}

.op-selector-dropdown {
    position: absolute;
    top: 12px;
    right: 130px;
    z-index: 998;
    width: 500px;
    max-height: 42px;
    /* 限制輸入框高度 */
    overflow-y: auto;
    /* 超出時顯示捲動 */
}

.op-selector .Select__value-container {
    overflow-y: auto !important;
    max-height: 40px !important;
}


.overview-button {
    position: relative;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background-color: #3390d6;
    /* 藍色主色 */
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.overview-button:hover {
    background-color: #007bff;
    transform: scale(1.05);
}

.flagged {
    background-color: rgba(0, 123, 255, 0.15) !important;
    box-shadow: none !important;
    border: 1px solid #999 !important;
}

.placed.flagged {
    background-color: rgba(0, 123, 255, 0.15) !important;
    box-shadow: none !important;
    border: 1px solid #999 !important;
}


.placed.spare {
    box-shadow: inset 6px 0 0 #6f42c1 !important;
    position: relative;
    /* 保險：讓元素有定位上下文 */
}



.Holiday {
    background-color: #dff0ea !important;
}

/* 導航按鈕容器 */
.nav-container {
    position: relative;
    /* top: 12px; */
    /* right: 240px; */
    /* 根據 Lock 的寬度 + 間距調整 */
    z-index: 998;
    display: flex;
    gap: 8px;
}

/* 個別按鈕樣式 */
.nav-button {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f5f5f5;
}

.nav-button:hover {
    background: #e0e0e0;
}

/* 外層捲動容器：允許上下左右滾動 */
.calender-grid-wrap {
    overflow: auto;
    max-height: 90vh;
    /* 你可依需求調整 */
    border: 1px solid #ddd;
}

/* sticky 表格的一般設定（你原本就有） */
.schedule-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
}

/* 固定第一列 */
.sticky-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8f9fa;
}

/* 固定第一欄（日期）並自己畫右側分隔線 */
.sticky-grid th:first-child,
.sticky-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    border-right: 1px solid #e3e3e3;
    /* 這條是關鍵：自己畫分隔線 */
    /* 可選：加一點陰影讓分隔更明顯 */
    box-shadow: 2px 0 0 rgba(0, 0, 0, 0.06);
}

/* 左上角（第一列＋第一欄）層級更高，並同樣畫右側分隔線 */
.sticky-grid thead th:first-child {
    left: 0;
    z-index: 4;
    background: #f1f3f5;
    border-right: 1px solid #e3e3e3;
}

/* 避免分隔線重疊：第二欄取消左邊框 */
.sticky-grid th:nth-child(2),
.sticky-grid td:nth-child(2) {
    border-left: none;
}


/* 右鍵功能表 */
.context-menu {
    position: fixed;
    /* 相對視窗，捲動不跑位 */
    z-index: 9999;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 4px 0;
    user-select: none;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.context-menu li:hover {
    background: #f1f3f5;
}

.context-menu li.disabled {
    color: #aaa;
    cursor: not-allowed;
    background: transparent !important;
}

/* foot：左上角 👣（維持你之前的貼齊與尺寸） */
.foot-icon {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(1px, 1px);
    font-size: 11px;
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

/* wrist：右上角 ۝（同樣小一點點） */
.wrist-icon {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(-1px, 1px);
    /* 往內縮 1px，避免壓到邊框 */
    font-size: 12px;
    /* 覺得太大可換 11px */
    line-height: 1;
    user-select: none;
    pointer-events: none;
}

/* 先前的「關聯淡化」樣式也搬進來 */
.associated-dimmed {
    opacity: 0.3;
    filter: grayscale(60%);
}

/* === 全螢幕載入遮罩 === */
#global-loading-overlay {
    position: fixed;
    inset: 0;
    /* top/right/bottom/left: 0 */
    display: none;
    /* show/hide 由 JS 控制 */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* 蓋在最上層 */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    pointer-events: all;
    /* 攔截所有點擊 */
    cursor: wait;
}

/* 轉圈圈圖示 */
.global-spinner {
    width: 64px;
    height: 64px;
    border: 6px solid rgba(0, 0, 0, 0.12);
    border-top-color: rgba(0, 0, 0, 0.75);
    border-radius: 50%;
    animation: global-spin 0.8s linear infinite;
}

/* 不讓背景滾動（顯示遮罩時套在 body） */
.app-locked {
    overflow: hidden !important;
}

@keyframes global-spin {
    to {
        transform: rotate(360deg);
    }
}


.setup-button {
    background: #f1f3f4;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    padding: 6px 10px;
    cursor: pointer;
    transition: 0.2s;
}

.setup-button:hover {
    background: #e0e0e0;
    border-color: #999;
}

.setup-button:active {
    background: #d5d5d5;
}


/* spare tickbox design*/

/* ===== Packed as Spare: pill style ===== */
.packed-spare-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 2px solid rgba(13, 110, 253, .35);
    background: rgba(13, 110, 253, .08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

/* hover 更醒目 */
.packed-spare-pill:hover {
    transform: translateY(-1px);
    background: rgba(13, 110, 253, .12);
    border-color: rgba(13, 110, 253, .55);
}

/* 文字 */
.packed-spare-text {
    font-size: 14px;
    /* font-weight: 700; */
    letter-spacing: .2px;
    color: #0b5ed7;
}

/* checkbox 放大 */
.packed-spare-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    transform: scale(1.15);
    cursor: pointer;
}

/* 勾選狀態更亮 */
.packed-spare-checkbox input[type="checkbox"]:checked {
    filter: saturate(1.2);
}

/* disabled / 已 Packup：整條灰掉、不可點 */
.packed-spare-checkbox input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: .75;
}

.packed-spare-pill:has(input[type="checkbox"]:disabled) {
    background: rgba(108, 117, 125, .12);
    border-color: rgba(108, 117, 125, .35);
    box-shadow: none;
}

.packed-spare-pill:has(input[type="checkbox"]:disabled) .packed-spare-text {
    color: rgba(108, 117, 125, .95);
}

/* ===== Packed as Spare: pill style ===== */

/* === Spare pill (dcc.Checklist) === */
.spare-pill {
    display: inline-flex;
    align-items: center;
}

/* Dash checklist 會產生 label，讓 label 變成 pill + flex 對齊 */
.spare-pill label {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;

    border: 1px solid rgba(0, 0, 0, 0.18);
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);

    cursor: pointer;
    user-select: none;

    font-size: 15px;
    font-weight: 600;
    line-height: 1;
}

/* checkbox 方框大小統一 + 顏色 */
.spare-pill input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;

    accent-color: #6f42c1;
    /* spare 紫色；你要橘色就改 #ff8c00 */
}

/* 避免文字 baseline 造成歪 */
.spare-pill label span {
    line-height: 1;
    display: inline-block;
    margin-left: 12px;
}