/* ==========================================
   會議室預約系統 - 現代化視覺 CSS 設計系統 (modernUI)
   ========================================== */

:root {
    /* 預設前台品牌色：企業 Logo 湖水藍 */
    --color-brand: #008cd3;
    --color-brand-hover: #007bb9;
    --color-brand-light: #f0f9ff;
    
    --color-bg: #f8fafc;
    --color-sidebar: #0f172a; /* 深灰藍 */
    --color-sidebar-item-active: #1e293b;
    --color-text-main: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-card-bg: #ffffff;
    
    /* 預約貼卡柔和配色 (Soft Pastels) */
    --color-pastel-blue-bg: #eff6ff;
    --color-pastel-blue-border: #3b82f6;
    --color-pastel-blue-text: #1e3a8a;
    
    --color-pastel-orange-bg: #fff7ed;
    --color-pastel-orange-border: #f97316;
    --color-pastel-orange-text: #7c2d12;
    
    --color-pastel-green-bg: #f0fdf4;
    --color-pastel-green-border: #22c55e;
    --color-pastel-green-text: #14532d;
    
    --color-pastel-purple-bg: #faf5ff;
    --color-pastel-purple-border: #a855f7;
    --color-pastel-purple-text: #581c87;

    --transition-smooth: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 個人會議看板專屬的紫色主題變數覆蓋 (識別度強化) */
.theme-purple {
    --color-brand: #1d4ed8; /* 個人會議：皇家藍/寶藍 */
    --color-brand-hover: #1e40af;
    --color-brand-light: #eff6ff;
}

body {
    background: var(--color-bg) !important;
    color: var(--color-text-main);
}

/* ==========================================
   1. 側邊欄與版面佈局 (Sidebar & Wrapper)
   ========================================== */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--color-sidebar);
    color: #fff;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
}

#sidebar.active {
    margin-left: -260px;
}

#sidebar .sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    background: transparent !important;
}

/* Logo 卡片融合 - 已優化為透明融合現代佈局 */
.logo-container {
    background: transparent !important;
    padding: 12px 0 !important;
    border-radius: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none !important;
    max-width: 180px;
    margin: 0 auto;
    border: none !important;
}

.logo-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

#sidebar ul.components {
    padding: 24px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

#sidebar ul p {
    color: rgba(255,255,255,0.4);
    padding: 0 10px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

#sidebar ul li a {
    padding: 12px 16px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    transition: var(--transition-smooth);
    text-decoration: none;
}

#sidebar ul li a i,
#sidebar ul li a svg {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    transform: translateX(4px);
}

#sidebar ul li.active > a {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    font-weight: 600;
    border-left: 4px solid var(--color-brand) !important;
    border-radius: 0 8px 8px 0 !important;
    box-shadow: none !important;
}

.theme-purple #sidebar ul li.active > a {
    border-left: 4px solid var(--color-brand) !important;
    box-shadow: none !important;
}

/* 側邊欄個人資訊卡 */
.sidebar-footer {
    padding: 20px 16px;
    background: transparent;
    border-top: none;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.profile-code {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

/* 主內容區 */
#content {
    width: 100%;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.custom-navbar {
    padding: 16px 20px;
    background: var(--color-card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#sidebarCollapse {
    background: var(--color-bg);
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

#sidebarCollapse:hover {
    background: var(--color-brand-light);
    color: var(--color-brand);
    border-color: var(--color-brand-light);
}

/* ==========================================
   2. 登入頁面與背景流光 (Login Style)
   ========================================== */
.login-bg-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.bg-circle {
    display: none !important;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: #2563eb;
    top: -100px;
    left: -100px;
    animation: float-slow 12s infinite alternate;
}

.circle-2 {
    width: 350px;
    height: 350px;
    background: #38bdf8;
    bottom: -80px;
    right: -80px;
    animation: float-slow 8s infinite alternate-reverse;
}

@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.1); }
}

.login-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: var(--transition-smooth);
    animation: card-appear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-appear {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.login-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.login-logo-box {
    background: #f8fafc;
    padding: 12px 24px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.04);
    margin-bottom: 16px;
}

.login-logo-box span {
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
}

/* ==========================================
   3. 表單、快速篩選與按鈕 (Forms & Cards)
   ========================================== */
.search-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    transition: var(--transition-smooth);
}

.search-card.open {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.search-header {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: #fff;
}

.search-title {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-title .icon-box {
    color: var(--color-brand);
    background: var(--color-brand-light);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle-icon {
    transition: var(--transition-smooth);
    color: var(--color-text-muted);
}

.search-card.open .search-toggle-icon {
    transform: rotate(90deg);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-card-full {
    grid-column: 1 / -1;
}

.form-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-card-title i {
    color: var(--color-brand);
}

.form-control, select.form-control {
    border-radius: 8px !important;
    border: 1px solid var(--color-border) !important;
    height: 42px !important;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--color-brand) !important;
    box-shadow: 0 0 0 3px rgba(0, 140, 211, 0.15) !important;
}

.theme-purple .form-control:focus {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15) !important;
}

/* 動作按鈕 */
.btn-brand-primary {
    background: var(--color-brand) !important;
    color: #fff !important;
    border: none !important;
    padding: 0 24px;
    height: 42px;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: var(--transition-smooth);
}

.btn-brand-primary:hover {
    background: var(--color-brand-hover) !important;
    box-shadow: 0 4px 10px rgba(0, 140, 211, 0.2);
    color: #fff !important;
}

.theme-purple .btn-brand-primary:hover {
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.2);
}

.btn-brand-outline {
    background: transparent !important;
    color: var(--color-brand) !important;
    border: 1.5px solid var(--color-brand) !important;
    padding: 0 24px;
    height: 42px;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: var(--transition-smooth);
}

.btn-brand-outline:hover {
    background: var(--color-brand-light) !important;
    color: var(--color-brand-hover) !important;
}

.btn-danger-outline {
    background: transparent !important;
    color: #ef4444 !important;
    border: 1.5px solid #ef4444 !important;
    padding: 0 24px;
    height: 42px;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: var(--transition-smooth);
}

.btn-danger-outline:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

/* ==========================================
   4. 週曆導覽與 DataTable 表格 (Grid / Table)
   ========================================== */
.week-navigator-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.01);
}

.week-range {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-arrow:hover {
    background: var(--color-brand-light);
    color: var(--color-brand);
    border-color: var(--color-brand-light);
}

/* 回到今天按鈕 */
.btn-today-purple {
    border: 1.5px solid var(--color-brand);
    color: var(--color-brand);
    background: transparent;
    font-weight: 700;
    border-radius: 20px;
    padding: 3px 14px;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-today-purple:hover {
    background: var(--color-brand-light);
    transform: scale(1.02);
}

/* 核心 DataTable 樣式 */
.table-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

#MeetOrder.dataTable thead th,
.fixedHeader-floating.dataTable thead th,
.modern-table th {
    background: #f1f5f9 !important;
    background-color: #f1f5f9 !important;
    font-weight: 700 !important;
    color: #334155 !important;
    padding: 16px !important;
    font-size: 0.9rem !important;
    text-align: center !important;
    border-bottom: 2px solid var(--color-border) !important;
    white-space: nowrap;
}

.modern-table td {
    padding: 16px 12px !important;
    border-bottom: 1px solid var(--color-border) !important;
    vertical-align: top !important;
    position: relative;
}

/* 會議室查詢的第一欄 (淺藍灰色) */
.modern-table td.room-col-blue {
    background: #f1f5f9 !important;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    border-right: 1px solid var(--color-border);
    vertical-align: middle;
    min-width: 130px;
}

/* 我的會議的第一欄 (淺藍色 - 區隔標記) */
.modern-table td.room-col-purple {
    background: var(--color-brand-light) !important;
    font-weight: 700;
    color: var(--color-brand) !important;
    text-align: center;
    border-right: 1px solid var(--color-border);
    vertical-align: middle;
    min-width: 130px;
}

.room-title-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.room-name {
    font-size: 0.95rem;
    color: var(--color-brand);
}

.room-capacity {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: normal;
}

/* 直欄高亮 (今天) */
.col-today {
    background: rgba(245, 158, 11, 0.05) !important;
    border-left: 1.5px solid rgba(245, 158, 11, 0.3) !important;
    border-right: 1.5px solid rgba(245, 158, 11, 0.3) !important;
}

th.col-today {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border-bottom: 2px solid #f59e0b !important;
}

/* 週末假日特殊底色 (星期日 nth-child(2) 與 星期六 nth-child(8)) */
.holiday-cell {
    background: #fff5f5 !important;
    color: #e11d48 !important;
}

th.holiday-cell {
    font-weight: 700;
}

/* 會議卡片 (Meet Badge) */
.meet-badge {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: var(--transition-smooth);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    text-align: left;
}

.meet-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.meet-badge-blue {
    background: var(--color-pastel-blue-bg) !important;
    border-left: 4px solid var(--color-pastel-blue-border) !important;
    color: var(--color-pastel-blue-text) !important;
}

.meet-badge-orange {
    background: var(--color-pastel-orange-bg) !important;
    border-left: 4px solid var(--color-pastel-orange-border) !important;
    color: var(--color-pastel-orange-text) !important;
}

.meet-badge-green {
    background: var(--color-pastel-green-bg) !important;
    border-left: 4px solid var(--color-pastel-green-border) !important;
    color: var(--color-pastel-green-text) !important;
}

.meet-badge-purple {
    background: var(--color-pastel-purple-bg) !important;
    border-left: 4px solid var(--color-pastel-purple-border) !important;
    color: var(--color-pastel-purple-text) !important;
}

/* === 4 色身份識別 Badge 樣式 ===
   1=主持人(紫), 2=參與者(藍), 3=申請人(綠), 4=無相關(灰)
   身份標籤小 Badge 以顯著對比色確保可讀性
*/

/* 1. 主持人 - 紫色系 (高飽和度，最顯眼) */
.meet-badge-host {
    background: #faf5ff !important;
    border-left: 4px solid #7c3aed !important;
    color: #4c1d95 !important;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.1) !important;
}
.meet-badge-host:hover {
    box-shadow: 0 6px 12px rgba(124, 58, 237, 0.18) !important;
    transform: translateY(-2px);
}

/* 2. 參與者 - 藍色系 */
.meet-badge-participant {
    background: #eff6ff !important;
    border-left: 4px solid #2563eb !important;
    color: #1e3a8a !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.08) !important;
}
.meet-badge-participant:hover {
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.15) !important;
    transform: translateY(-2px);
}

/* 3. 申請人 - 翠綠色系（最重要，有編輯權）*/
.meet-badge-applicant {
    background: #ecfdf5 !important;
    border-left: 4px solid #059669 !important;
    color: #064e3b !important;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.1) !important;
}
.meet-badge-applicant:hover {
    box-shadow: 0 6px 12px rgba(5, 150, 105, 0.18) !important;
    transform: translateY(-2px);
}

/* 4. 無相關 - 灰色系（僅出現於全體行事曆 mrSeach）*/
.meet-badge-none {
    background: #f8fafc !important;
    border-left: 4px solid #94a3b8 !important;
    color: #475569 !important;
    box-shadow: 0 1px 3px rgba(148, 163, 184, 0.06) !important;
}
.meet-badge-none:hover {
    box-shadow: 0 4px 8px rgba(148, 163, 184, 0.12) !important;
    transform: translateY(-2px);
}

/* === 身份小標籤 (右上角角標) ===
   顯示在 meet-badge-title 右側，高對比色確保可讀性
*/
.badge-role {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.3px;
}
.badge-host        { background: #7c3aed; color: #ffffff; } /* 紫底白字 */
.badge-participant { background: #2563eb; color: #ffffff; } /* 藍底白字 */
.badge-applicant   { background: #059669; color: #ffffff; } /* 綠底白字 */
.badge-none        { background: #64748b; color: #ffffff; } /* 灰底白字 */

/* 相容舊版 class（暫時保留，避免其他地方引用斷掉）*/
.meet-badge-self {
    background: #faf5ff !important;
    border-left: 4px solid #7c3aed !important;
    color: #4c1d95 !important;
}
.meet-badge-invited {
    background: #f8fafc !important;
    border-left: 4px solid #64748b !important;
    color: #334155 !important;
}

.meet-badge-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meet-badge-time {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.meet-badge-host {
    font-size: 0.78rem;
    opacity: 0.8;
}

/* 我的預約卡片內的動作欄 */
.meet-badge-actions {
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 8px;
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-badge-action {
    background: transparent;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-badge-edit {
    color: var(--color-brand);
}

.btn-badge-edit:hover {
    background: var(--color-brand-light);
}

.btn-badge-del {
    color: #ef4444;
}

.btn-badge-del:hover {
    background: #fef2f2;
}

/* 快速新增預約按鈕 */
.btn-add-booking {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px dashed var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
    cursor: pointer;
    margin: 4px auto;
}

.btn-add-booking:hover {
    background: var(--color-brand-light);
    color: var(--color-brand);
    border-color: var(--color-brand);
    transform: scale(1.1);
}

/* ==========================================
   5. iOS Toggle Switch 和穿梭選單 (Toggle & Shuttle)
   ========================================== */
.custom-switch-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.custom-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin: 0;
}

.custom-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color-brand);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.switch-label-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.switch-title-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* 人員穿梭選單 */
.selectbox {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.select-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.select-bar h5 {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin: 0;
}

.selectM {
    height: 220px !important;
    border-radius: 8px !important;
    border: 1px solid var(--color-border) !important;
    padding: 8px !important;
}

.selectM option {
    padding: 6px 10px !important;
    border-radius: 4px !important;
    margin-bottom: 2px !important;
    font-size: 0.9rem !important;
}

.selectM option:hover {
    background-color: var(--color-brand-light) !important;
    color: var(--color-brand) !important;
}

.btn-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 4px;
}

.btn-shuttle {
    width: 40px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-muted);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-shuttle:hover {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
    box-shadow: 0 4px 6px rgba(0, 140, 211, 0.2);
}

.theme-purple .btn-shuttle:hover {
    box-shadow: 0 4px 6px rgba(29, 78, 216, 0.2);
}

/* 週期性面板漸變摺疊 */
.periodic-settings {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition-smooth);
    overflow: hidden;
}

.periodic-settings.active {
    grid-template-rows: 1fr;
}

.periodic-content {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--color-border);
    margin-top: 8px;
}

/* ==========================================
   6. timeoutModal (防過期重新登入彈窗) 美化
   ========================================== */
.modal-backdrop.show {
    backdrop-filter: blur(8px);
    background-color: rgba(15, 23, 42, 0.4);
}

.custom-timeout-content {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    overflow: hidden;
    animation: modal-zoom-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-zoom-in {
    0% { transform: scale(0.9) translateY(10px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.custom-timeout-header {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    color: white !important;
    border: none !important;
    padding: 24px !important;
}

.custom-timeout-title {
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.custom-timeout-body {
    padding: 30px !important;
    background: #fff !important;
}

.custom-timeout-footer {
    background: #f8fafc !important;
    border-top: 1px solid var(--color-border) !important;
    padding: 20px 30px !important;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary-custom {
    background: #fff !important;
    color: #64748b !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    transition: var(--transition-smooth);
}

.btn-secondary-custom:hover {
    background: #f1f5f9 !important;
    color: #334155 !important;
}

.btn-primary-custom {
    background: var(--color-brand) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    padding: 10px 24px !important;
    transition: var(--transition-smooth);
}

.btn-primary-custom:hover {
    background: var(--color-brand-hover) !important;
    box-shadow: 0 4px 12px rgba(0, 140, 211, 0.2);
}

/* ==========================================
   7. 週期預約佈局修復與卡片外框同一組優化
   ========================================== */

/* 日期卡片設定 */
.date-settings-card {
    transition: all 0.25s ease-in-out;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* 當週期預約選項顯示時，將起訖日期包在同一個方框中 */
.form-card:has(.periodic-settings:not([style*="display: none"]):not([style*="display:none"])) .date-settings-card,
.date-settings-card.card-active {
    background: #f8fafc !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
}

/* 週期性預約設定內核取方塊 (Checkbox) 定位修復，解決往左超出切邊問題 */
.periodic-settings .form-check-input,
.periodic-settings input[type="checkbox"] {
    position: static !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-right: 8px !important;
}

/* 強制讓重複星期的 flex 容器排列美觀，防止因 margins 混亂造成不對齊 */
.rptTypeW .d-flex {
    margin-right: 0 !important;
}

/* ==========================================
   8. 與會人員選取穿梭框對稱排版與三欄佈局優化
   ========================================== */

.shuttle-container {
    width: 100%;
}

.shuttle-layout {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

.shuttle-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.shuttle-header {
    height: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.shuttle-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.shuttle-column select.selectM {
    height: 250px !important;
    width: 100% !important;
    border-radius: 8px !important;
    border: 1px solid var(--color-border) !important;
    padding: 8px !important;
    background-color: #ffffff !important;
}

/* 中間按鈕直欄 */
.shuttle-btn-column {
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px; /* 剛好與下方 select 框的頂部切齊 (40px header + 8px margin) */
}

.shuttle-btn-column .btn-brand-outline {
    height: 32px;
    padding: 0 !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    border: 1px solid var(--color-brand) !important;
    color: var(--color-brand) !important;
    background-color: transparent !important;
    transition: all 0.2s ease;
}

.shuttle-btn-column .btn-brand-outline:hover {
    background-color: var(--color-brand) !important;
    color: #ffffff !important;
}

/* ==========================================
   9. 側邊欄收合圓鈕與登出按鈕佈局樣式
   ========================================== */

/* 側邊欄收合浮動圓鈕 */
.btn-sidebar-toggle {
    position: fixed;
    left: 244px;
    top: 24px;
    z-index: 1050;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: var(--color-brand) !important;
    border: 1.5px solid #ffffff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1), background 0.3s, transform 0.2s;
    color: #ffffff !important;
}

/* 側邊欄收合後的按鈕位移狀態 */
.btn-sidebar-toggle.collapsed-toggle {
    left: 8px !important;
}

.btn-sidebar-toggle i,
.btn-sidebar-toggle svg {
    display: inline-block !important;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.btn-sidebar-toggle.collapsed-toggle i,
.btn-sidebar-toggle.collapsed-toggle svg {
    transform: rotate(180deg) !important;
}

.btn-sidebar-toggle:hover {
    background: var(--color-brand-hover) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0,0,0,0.2) !important;
}

.btn-sidebar-toggle:focus {
    outline: none;
}

/* 側邊欄專屬登出按鈕 */
.btn-logout-sidebar {
    background: transparent;
    border: none;
    color: #ef4444 !important;
    font-size: 1.15rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

/* 移除頂部導覽列後，主內容自動自然向上貼緊 */
#content {
    padding-top: 24px !important;
}

/* 改善唯讀/禁止編輯 (disabled) 狀態下與會人員名單的文字對比度 */
select.selectM:disabled {
    background-color: #f8f9fa !important;
    color: #2b2b2b !important;
    cursor: not-allowed;
    opacity: 1 !important;
}

select.selectM:disabled option {
    color: #2b2b2b !important;
    -webkit-text-fill-color: #2b2b2b !important;
    background-color: #ffffff !important;
    opacity: 1 !important;
}

