/* 響應式設計 (responsive.css) */

/* 漢堡選單按鈕 */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #003366;
    cursor: pointer;
    margin-right: 16px;
    padding: 0 8px;
    transition: transform 0.2s;
}

.menu-toggle:active {
    transform: scale(0.9);
}

/* 用於修正 header 空間 */
.header-left {
    display: flex;
    align-items: center;
}

/* 響應式文字切換 */
.mobile-text {
    display: none;
}
.desktop-text {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-text {
        display: inline;
    }
    .desktop-text {
        display: none;
    }
    .menu-toggle {
        display: block;
    }
    
    /* 側邊欄變為滑動面板 */
    .sidebar {
        position: fixed;
        left: -280px; /* 預設收起 */
        top: 0;
        bottom: 0;
        width: 280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: 4px 0 25px rgba(0,0,0,0.5);
    }
    
    .sidebar.sidebar-open {
        left: 0;
    }
    
    /* 配合側邊欄收合，主容器撐開 */
    .main-wrapper {
        width: 100%;
    }
    
    /* 底部操作列滿版 */
    .fixed-bottom-bar {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 0;
        border-radius: 0;
        padding: 12px 16px;
    }

    /* 遮罩層 (當 sidebar 打開時) */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 34, 68, 0.6); /* 品牌深色半透明 */
        backdrop-filter: blur(4px);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

    /* 頂部列精簡化 */
    .breadcrumb {
        display: none; /* 手機版隱藏麵包屑以節省空間 */
    }
    .user-profile .user-info {
        display: none; /* 手機版隱藏姓名，只留公司與登出 */
    }
    .user-profile .company-badge {
        font-size: 12px;
        padding: 4px 8px;
    }

    /* 頁首工具列斷行 */
    .page-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .toolbar-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .search-box {
        width: 100%;
    }

    /* 內容區塊內縮優化：增加外部呼吸空間 */
    .page-body {
        padding: 12px 12px !important; /* 恢復適度邊距 */
        padding-bottom: 80px !important;
    }
    
    .content-card, .glass-card {
        padding: 12px 10px !important; /* 卡片內部邊距同步調整 */
    }

    /* 修正頂部固定容器在手機版的邊距，防止內容被截斷 */
    .sticky-container {
        margin: -12px -12px 16px -12px !important;
        padding: 12px 12px 8px 12px !important;
        width: auto !important;
    }


    /* 銷貨明細表格：手機版強制維持寬度以顯示完整資料 */
    .items-table {
        min-width: 950px !important; /* 總寬度與桌面版欄位設定一致 */
    }
    
    /* 表單變為單欄 */
    /* 表單變為單欄 */
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* 表單欄位極窄排版優化：同列顯示但消除左側空白 */
    .form-group {
        flex-direction: row !important; /* 恢復同列 */
        align-items: center !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        flex-wrap: nowrap !important;
    }

    .form-label {
        flex: 0 0 auto !important;
        width: 85px !important;    /* 精簡寬度 */
        text-align: right !important;
        padding-left: 0 !important;
        font-size: 14px !important;
        margin-bottom: 0 !important;
    }

    .form-control-wrapper {
        flex: 1 !important;
        width: auto !important;
    }

    /* 產品清單工具列優化 */
    .list-toolbar-container {
        padding: 16px !important;
        gap: 16px !important;
    }

    .pagination-controls {
        width: 100% !important;
        justify-content: space-between;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 12px;
    }
    
    .pagination-controls #sel-page {
        flex: 1;
        width: auto !important;
    }

    /* 頁面標題列操作按鈕 (取消/存檔等) 保持橫向並排 */
    .page-header .toolbar-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important; /* 改為左對齊，防止左側被截斷 */
        align-items: center !important;
        gap: 8px !important;
        overflow-x: auto;
        padding-bottom: 8px;
        padding-left: 4px; /* 增加一點左邊距 */
        -webkit-overflow-scrolling: touch;
    }

    /* 產品清單工具列 (篩選/搜尋) 恢復為縱向多行排列 */
    .list-toolbar-container .toolbar-content {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    
    .list-toolbar-container .toolbar-left {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .list-toolbar-container .toolbar-right {
        display: flex !important;
        flex-direction: row !important; /* 使搜尋欄與新增按鈕並排 */
        gap: 8px !important;
        width: 100% !important;
    }
    
    .list-toolbar-container .toolbar-right .search-box {
        flex: 1 !important; /* 搜尋欄自動縮短以騰出空間 */
        width: auto !important;
        min-width: 0 !important;
    }
    
    .list-toolbar-container .toolbar-actions {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        overflow-x: visible !important;
        flex-wrap: wrap !important;
    }

    .filter-row {
        width: 100% !important;
        justify-content: stretch !important;
    }

    .filter-row select {
        flex: 1;
        width: 50% !important;
    }

    .toolbar-actions .search-box {
        width: auto !important;
        flex: 1;
        min-width: 200px;
    }

    .list-toolbar-container .btn {
        width: auto !important; /* 寬度依內容自動縮短 */
        padding: 6px 12px !important; /* 更精簡的內距 */
        font-size: 13px !important;
        height: 36px !important; /* 縮小高度 */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    /* 全域手機版按鈕寬度縮短：除非是 .btn-block，否則不強制寬度 */
    .btn:not(.btn-block) {
        width: fit-content !important;
        min-width: 0 !important;
        padding: 8px 16px !important;
        white-space: nowrap !important;
    }

    .page-header .toolbar-actions .btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        white-space: nowrap !important;
        font-size: 0 !important;        /* 隱藏按鈕內文字 */
        border-radius: 8px !important;
        flex: 0 0 auto !important;     /* 固定寬度不縮放 */
        position: relative;             /* 用於 Tooltip 定位 */
    }

    .page-header .toolbar-actions .btn i {
        font-size: 18px !important;
        margin: 0 !important;
    }

    /* 懸停時顯示提示文字 (Tooltip) */
    @media (hover: hover) {
        .page-header .toolbar-actions .btn:hover::after {
            content: attr(title);
            position: absolute;
            top: -40px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 51, 102, 0.9);
            color: #fff;
            padding: 5px 10px;
            border-radius: 6px;
            font-size: 12px !important;
            white-space: nowrap;
            z-index: 1000;
            pointer-events: none;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        /* Tooltip 小三角 */
        .page-header .toolbar-actions .btn:hover::before {
            content: "";
            position: absolute;
            top: -10px;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: rgba(0, 51, 102, 0.9);
            z-index: 1000;
        }
    }



    /* 恢復為表列式佈局，並啟用左右滑動 */
    .data-table {
        display: table !important;
        width: 100% !important;
        min-width: 850px !important; /* 確保寬度足夠觸發捲軸並保持對齊 */
        border-collapse: collapse !important;
    }

    .data-table thead {
        display: table-header-group !important;
    }

    .data-table tbody {
        display: table-row-group !important;
    }

    .data-table tr {
        display: table-row !important;
    }

    .data-table th,
    .data-table td {
        display: table-cell !important;
        width: auto !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        white-space: nowrap !important;
        text-align: left !important;
    }

    .data-table th {
        background-color: #003366 !important;
        color: #fff !important;
        font-weight: 600 !important;
    }

    .data-table td::before {
        display: none; /* 隱藏 data-label 標籤 */
    }

    /* 容器溢出處理 */
    .glass-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch; /* 讓 iOS 手感更順滑 */
    }

    .data-table {
        min-width: 800px; /* 強制表格寬度，觸發捲軸 */
    }

    /* 客戶管理 - 聯絡資料卡片優化 */
    .form-control-wrapper {
        display: flex !important;
        gap: 10px !important;
        width: 100%;
    }

    .form-control-wrapper .form-control {
        flex: 1; /* 輸入框撐開 */
        min-width: 0; /* 防止溢出 */
    }

    .form-control-wrapper .btn-outline {
        width: 48px !important; /* 增加按鈕點擊面積 */
        height: 42px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background-color: #f8fafc !important;
        border: 1px solid #003366 !important;
        color: #003366 !important;
        border-radius: 8px !important;
    }

    .form-control-wrapper .btn-outline i {
        font-size: 18px !important;
    }

    /* 地址欄位在手機版特別處理 */
    .form-group[style*="grid-column: span 2"] {
        grid-column: span 1 !important; /* 恢復單欄 */
    }
}

/* ====================================================
 * HR 系統手機版一致性修正（2026-09-01）
 * 一般資料表改為卡片顯示；排班矩陣等專用表格維持自身捲動規則。
 * ==================================================== */
@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-container,
    .main-content {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
    }

    .sticky-container {
        top: 0 !important;
    }

    .page-title {
        font-size: 22px !important;
        line-height: 1.35;
    }

    /* 手機觸控範圍統一至少 44px，並保留可辨識文字。 */
    .menu-btn,
    .btn-logout,
    .btn,
    .list-toolbar-container .btn,
    .page-header .toolbar-actions .btn {
        min-height: 44px !important;
    }

    .menu-btn {
        min-width: 44px;
        padding: 8px !important;
    }

    .btn-logout {
        min-width: 44px;
        padding: 8px 12px;
    }

    .page-header .toolbar-actions {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
    }

    .page-header .toolbar-actions .btn {
        width: auto !important;
        height: 44px !important;
        padding: 8px 14px !important;
        font-size: 14px !important;
    }

    .page-header .toolbar-actions .btn i {
        font-size: 16px !important;
    }

    /* 篩選工具列在窄畫面改為逐列排列，避免日期與按鈕互相擠壓。 */
    .list-toolbar-container .toolbar-left,
    .list-toolbar-container .toolbar-right,
    .list-toolbar-container .filter-item,
    .filter-row {
        width: 100% !important;
    }

    .list-toolbar-container .toolbar-left,
    .list-toolbar-container .toolbar-right {
        flex-wrap: wrap !important;
        align-items: stretch !important;
    }

    .list-toolbar-container .filter-item {
        display: grid !important;
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 8px !important;
    }

    .list-toolbar-container .filter-item .form-control,
    .list-toolbar-container .date-input-wrapper,
    .list-toolbar-container .date-input,
    .toolbar-actions .search-box {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* 後台設定頁的多欄表單改為單欄，欄名置於輸入框上方。 */
    .form-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .form-col {
        width: 100% !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }

    .form-col .form-label {
        width: auto !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    /* 一般資料表在手機版以一筆一張卡片呈現，所有欄位內容均保留。 */
    .glass-card {
        overflow-x: visible !important;
    }

    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    table.data-table,
    table.data-table.card-table-mobile {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    table.data-table thead,
    table.data-table.card-table-mobile thead {
        display: none !important;
    }

    table.data-table tbody,
    table.data-table.card-table-mobile tbody {
        display: block !important;
        width: 100% !important;
    }

    table.data-table tr,
    table.data-table.card-table-mobile tr {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        margin-bottom: 12px !important;
        padding: 6px 0 !important;
        overflow: hidden;
        border: 1px solid #cbd5e1 !important;
        border-radius: 10px !important;
        background: #ffffff !important;
        box-shadow: 0 2px 6px rgba(0, 51, 102, 0.06) !important;
    }

    table.data-table td,
    table.data-table.card-table-mobile td {
        display: grid !important;
        grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
        align-items: start !important;
        width: 100% !important;
        padding: 9px 12px !important;
        border-right: none !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        background: #ffffff !important;
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    table.data-table td:last-child,
    table.data-table.card-table-mobile td:last-child {
        border-bottom: none !important;
    }

    table.data-table td::before,
    table.data-table.card-table-mobile td::before {
        content: attr(data-label) !important;
        display: block !important;
        min-width: 0 !important;
        margin-right: 12px !important;
        color: #64748b !important;
        font-weight: 600 !important;
        text-align: left !important;
    }

    table.data-table td[colspan],
    table.data-table.card-table-mobile td[colspan] {
        display: block !important;
        padding: 16px !important;
        text-align: center !important;
    }

    table.data-table td[colspan]::before,
    table.data-table.card-table-mobile td[colspan]::before {
        display: none !important;
        content: none !important;
    }

    /* 不可因卡片規則重新顯示原本由功能邏輯隱藏的列或欄位。 */
    table.data-table tr[hidden],
    table.data-table td[hidden],
    table.data-table tr[style*="display:none"],
    table.data-table tr[style*="display: none"],
    table.data-table td[style*="display:none"],
    table.data-table td[style*="display: none"] {
        display: none !important;
    }

    table.data-table td .btn {
        min-width: 44px !important;
        min-height: 44px !important;
    }

    /* 首頁最新公告：手機版比照請假待審，保留六欄表格並提供左右滑動。 */
    .board-list-card.glass-card {
        overflow: hidden !important;
    }

    .board-table-wrapper {
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .data-table.board-table {
        display: table !important;
        width: 100% !important;
        min-width: 850px !important;
        margin: 0 !important;
        border-collapse: collapse !important;
        background: #ffffff !important;
    }

    .data-table.board-table thead {
        display: table-header-group !important;
    }

    .data-table.board-table tbody {
        display: table-row-group !important;
    }

    .data-table.board-table thead tr {
        display: table-row !important;
    }

    .data-table.board-table th {
        display: table-cell !important;
        width: auto !important;
        padding: 12px 16px !important;
        white-space: nowrap !important;
        text-align: left !important;
    }

    .data-table.board-table .board-row,
    .data-table.board-table .board-state-row {
        display: table-row !important;
    }

    .data-table.board-table .board-row td,
    .data-table.board-table .board-state-row td {
        display: table-cell !important;
        width: auto !important;
        padding: 12px 16px !important;
        white-space: nowrap !important;
        text-align: left !important;
    }

    .data-table.board-table .board-row td::before,
    .data-table.board-table .board-state-row td::before {
        display: none !important;
        content: none !important;
    }

    .data-table.board-table .board-content-cell {
        white-space: pre-wrap !important;
        min-width: 280px;
    }

    .data-table.board-table .board-title-cell {
        min-width: 200px;
    }

    .data-table.board-table .board-attachment-cell {
        text-align: center !important;
    }

    .data-table.board-table .board-attachment-cell .btn {
        min-width: 90px !important;
        min-height: 0 !important;
    }

    .data-table.board-table .board-state-row td {
        padding: 20px !important;
        text-align: center !important;
    }

    .empty-state {
        padding: 28px 16px !important;
    }

    /* 彈窗保留手機安全邊距，並使用動態視窗高度避免被鍵盤遮住。 */
    .modal {
        padding: 12px;
    }

    .modal-content {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100vh - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
        border-radius: 12px !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* 員工排班頁保留矩陣橫向捲動，但外部控制列必須可換行。 */
    .page-container {
        padding: 0 !important;
    }

    .schedule-table-wrapper {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .action-bar {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .toast-container {
        right: 12px !important;
        left: 12px !important;
        bottom: 12px !important;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .list-toolbar-container .toolbar-right .btn,
    .action-bar .btn {
        width: 100% !important;
    }

    .action-bar > div[style*="flex: 1"] {
        display: none;
    }

    .month-nav {
        flex-wrap: wrap;
    }
}


/* 首頁手機版採米白背景、深藍按鈕與琥珀金互動外框，不影響桌面版。 */
@media (max-width: 768px) {
    .home-dashboard .app-container {
        background: #f3f0ea !important;
    }

    .home-dashboard .main-content {
        min-width: 0;
    }

    .home-dashboard .top-nav {
        background: #173a63;
    }

    .home-dashboard .page-title {
        color: #173a63 !important;
        text-shadow: none;
    }

    .home-dashboard .page-header {
        border-bottom-color: #c7c5c0 !important;
    }

    .home-dashboard .dashboard-category {
        margin-bottom: 20px;
    }

    .home-dashboard .dashboard-category > .category-title {
        display: flex;
        gap: 8px;
        margin-bottom: 10px;
        padding: 8px 0;
        border: none !important;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: #173a63;
        font-size: 17px;
        letter-spacing: 0;
        text-shadow: none;
    }

    .home-dashboard .category-title:hover {
        transform: none;
    }

    .home-dashboard .category-title::before,
    .home-dashboard .dashboard-category > .category-title i:first-of-type {
        color: #173a63;
        filter: none;
    }

    .home-dashboard .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        padding: 3px 0 6px;
    }

    .home-dashboard .dashboard-grid > .module-card {
        min-width: 0;
        min-height: 110px;
        padding: 12px 4px !important;
        justify-content: flex-start;
        border-radius: 12px !important;
        background: #214e7a !important;
        border: 1px solid #214e7a !important;
        box-shadow: 0 3px 6px rgba(20, 51, 88, 0.24) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        overflow: hidden !important;
        transition: background-color 0.2s, border-color 0.2s;
    }

    .home-dashboard .module-card::before {
        display: none;
    }

    /* 互動狀態提高選擇器優先序，避免首頁內嵌桌面滑入規則將圖示改白、文字改淺。 */
    .home-dashboard .module-card .module-icon,
    .home-dashboard .module-card:hover .module-icon,
    .home-dashboard .module-card:focus-visible .module-icon,
    .home-dashboard .module-card:active .module-icon {
        font-size: 40px;
        line-height: 1;
        margin-bottom: 9px;
        color: #ffffff;
        filter: none;
        transform: none;
    }

    .home-dashboard .module-card .module-title,
    .home-dashboard .module-card:hover .module-title,
    .home-dashboard .module-card:focus-visible .module-title,
    .home-dashboard .module-card:active .module-title {
        width: 100%;
        margin: 0;
        color: #ffffff;
        font-size: 14px;
        line-height: 1.35;
        letter-spacing: 0;
        overflow-wrap: anywhere;
        text-shadow: none;
    }

    /* 原說明文字保留在文件中，僅於手機版隱藏。 */
    .home-dashboard .module-card .module-desc {
        display: none;
    }

    /* 琥珀金外框向內繪製，與深藍按鈕清楚對比且不推擠按鈕排列。 */
    .home-dashboard .dashboard-grid > .module-card:hover,
    .home-dashboard .dashboard-grid > .module-card:active,
    .home-dashboard .dashboard-grid > .module-card:focus-visible {
        background: #214e7a !important;
        border-color: #f5b83d !important;
        outline: 4px solid #f5b83d;
        outline-offset: -4px;
    }
}


/* 公告手機清單預設隱藏，桌面繼續使用原有六欄表格。 */
.home-dashboard .board-mobile-list {
    display: none;
}

@media (max-width: 768px) {
    .home-dashboard .board-list-card {
        display: none;
    }

    .home-dashboard .board-mobile-list {
        display: block;
        overflow: hidden;
        border: 1px solid #c5ddf8;
        border-radius: 10px;
        background: #ffffff;
        color: #173a63;
        box-shadow: 0 3px 6px rgba(20, 51, 88, 0.2);
    }

    .home-dashboard .board-mobile-entry + .board-mobile-entry {
        border-top: 1px solid #d8e5f5;
    }

    .home-dashboard .board-mobile-summary {
        display: grid;
        grid-template-columns: 80px minmax(0, 1fr);
        align-items: baseline;
        gap: 10px;
        min-height: 48px;
        padding: 12px;
        cursor: pointer;
        list-style: none;
    }

    .home-dashboard .board-mobile-summary::-webkit-details-marker {
        display: none;
    }

    .home-dashboard .board-mobile-summary:focus-visible {
        outline: 3px solid #075ce5;
        outline-offset: -3px;
    }

    .home-dashboard .board-mobile-date {
        color: #52677f;
        font-size: 13px;
        white-space: nowrap;
    }

    .home-dashboard .board-mobile-title {
        color: #0752c7;
        font-size: 15px;
        font-weight: 700;
        text-decoration: underline;
        text-underline-offset: 3px;
        overflow-wrap: anywhere;
    }

    .home-dashboard .board-mobile-entry[open] .board-mobile-summary {
        background: #edf5ff;
    }

    .home-dashboard .board-mobile-detail {
        padding: 12px;
        border-top: 1px solid #d8e5f5;
        background: #f6faff;
        font-size: 14px;
        overflow-wrap: anywhere;
    }

    .home-dashboard .board-mobile-meta {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 4px 12px;
        margin-bottom: 12px;
    }

    .home-dashboard .board-mobile-meta dt {
        color: #52677f;
    }

    .home-dashboard .board-mobile-meta dd {
        margin: 0;
    }

    .home-dashboard .board-mobile-content {
        margin: 0 0 12px;
        white-space: pre-wrap;
        line-height: 1.7;
    }

    .home-dashboard .board-mobile-state {
        padding: 16px 12px;
        color: #52677f;
        font-size: 14px;
    }

    .home-dashboard .board-mobile-state.is-error {
        color: #b91c1c;
    }
}


/* 首頁桌面公告標題開啟原生預覽視窗，樣式集中在共用 CSS。 */
.home-dashboard .board-title-preview {
    border: 0;
    padding: 4px 0;
    background: transparent;
    color: #0752c7;
    font: inherit;
    font-weight: 700;
    text-align: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.home-dashboard .board-title-preview:hover {
    color: #003366;
}

.home-dashboard .board-title-preview:focus-visible,
.home-dashboard .board-preview-close:focus-visible {
    outline: 3px solid #075ce5;
    outline-offset: 2px;
}

.home-dashboard .board-preview {
    position: fixed;
    inset: 0;
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid #c5ddf8;
    border-radius: 14px;
    background: #ffffff;
    color: #173a63;
    box-shadow: 0 16px 56px rgba(0, 34, 68, 0.3);
}

.home-dashboard .board-preview::backdrop {
    background: rgba(0, 34, 68, 0.55);
}

.home-dashboard .board-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #d8e5f5;
    background: #edf5ff;
}

.home-dashboard .board-preview-header h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.home-dashboard .board-preview-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid #c5ddf8;
    border-radius: 8px;
    background: #ffffff;
    color: #173a63;
    font-size: 28px;
    cursor: pointer;
}

.home-dashboard .board-preview-body {
    padding: 20px;
    overflow-wrap: anywhere;
}

.home-dashboard .board-preview-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 16px;
    margin: 0 0 20px;
    font-size: 14px;
}

.home-dashboard .board-preview-meta dt {
    color: #52677f;
}

.home-dashboard .board-preview-meta dd {
    margin: 0;
}

.home-dashboard .board-preview-content {
    margin: 0 0 20px;
    white-space: pre-wrap;
    line-height: 1.8;
}


/* 首頁桌面與手機統一配色，保留各尺寸原有排列與全部文字。 */
.home-dashboard .app-container {
    background: #f3f0ea !important;
}

.home-dashboard .top-nav,
.home-dashboard .sidebar {
    background: #173a63 !important;
}

.home-dashboard .page-title {
    color: #173a63 !important;
    text-shadow: none;
}

.home-dashboard .page-header {
    border-bottom-color: #c7c5c0 !important;
}

.home-dashboard .breadcrumb {
    color: #52677f !important;
}

.home-dashboard .dashboard-category > .category-title {
    color: #173a63;
    background: #f3f0ea;
    border-color: #cbc7bf !important;
    text-shadow: none;
    box-shadow: none;
}

.home-dashboard .category-title::before {
    color: inherit;
}

.home-dashboard .dashboard-category > .category-title i:first-of-type {
    color: inherit !important;
    filter: none;
}

.home-dashboard .dashboard-grid > .module-card,
.home-dashboard .dashboard-grid > .module-card:hover {
    background: #214e7a !important;
    border-color: #214e7a !important;
    box-shadow: 0 3px 6px rgba(20, 51, 88, 0.24) !important;
}

.home-dashboard .dashboard-grid > .module-card .module-icon,
.home-dashboard .dashboard-grid > .module-card:hover .module-icon,
.home-dashboard .dashboard-grid > .module-card:active .module-icon,
.home-dashboard .dashboard-grid > .module-card:focus-visible .module-icon {
    color: #ffffff;
    filter: none;
}

.home-dashboard .dashboard-grid > .module-card .module-title,
.home-dashboard .dashboard-grid > .module-card:hover .module-title,
.home-dashboard .dashboard-grid > .module-card:active .module-title,
.home-dashboard .dashboard-grid > .module-card:focus-visible .module-title {
    color: #ffffff;
    text-shadow: none;
}

.home-dashboard .module-card .module-desc {
    color: #e3edf7;
}

.home-dashboard .module-card::before {
    display: none;
}

/* 向內繪製金色外框，避免互動時尺寸或文字位置改變。 */
.home-dashboard .dashboard-grid > .module-card:hover,
.home-dashboard .dashboard-grid > .module-card:active,
.home-dashboard .dashboard-grid > .module-card:focus-visible {
    border-color: #f5b83d !important;
    outline: 4px solid #f5b83d;
    outline-offset: -4px;
}

.home-dashboard .sidebar .nav-item {
    color: #edf3fa !important;
}

.home-dashboard .sidebar .nav-item.active {
    background: #214e7a;
    border-left-color: #f5b83d;
    color: #ffffff !important;
}

.home-dashboard .sidebar .nav-item:hover,
.home-dashboard .sidebar .nav-group-header:hover {
    background: #214e7a;
    color: #ffffff !important;
}

.home-dashboard .sidebar .nav-group-header {
    color: #edf3fa;
}

.home-dashboard .sidebar-copyright {
    color: #c6d5e6;
}

.home-dashboard .board-list-card {
    background: #ffffff;
    border-color: #cbc7bf;
}

.home-dashboard .data-table.board-table thead th {
    background: #173a63 !important;
}

/* =========================================================================
 * 首頁智慧工作台升級樣式：全域指令列 (Ctrl+K)、快篩膠囊、常用功能、系統導航流程圖
 * ========================================================================= */
.home-dashboard {
    --home-bg: #f3f0ea;
    --home-nav: #173a63;
    --home-card: #214e7a;
    --home-accent: #f5b83d;
}

.home-dashboard .page-header.home-hero-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* 1.1 全域智慧搜尋與快速指令列 (Ctrl + K) */
.home-dashboard .home-command-wrapper {
    position: relative;
    flex: 0 1 460px;
    width: 100%;
    max-width: 460px;
}
.home-dashboard .home-command-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #ffffff;
    border: 2px solid #b8c4d4;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(23, 58, 99, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.home-dashboard .home-command-bar:focus-within {
    border-color: var(--home-nav);
    box-shadow: 0 0 0 4px rgba(245, 184, 61, 0.35), 0 8px 20px rgba(23, 58, 99, 0.14);
}
.home-dashboard .cmd-search-icon {
    color: var(--home-nav);
    font-size: 16px;
    flex-shrink: 0;
}
.home-dashboard .cmd-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
}
.home-dashboard .cmd-input::placeholder {
    color: #64748b;
    font-weight: 400;
}
.home-dashboard .cmd-clear-btn {
    background: #e2e8f0;
    border: none;
    color: #334155;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.home-dashboard .cmd-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}
.home-dashboard .cmd-kbd {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

/* 浮動下拉快速跳轉建議面板 (Command Palette) */
.home-dashboard .home-command-palette {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid var(--home-nav);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(23, 58, 99, 0.25);
    z-index: 250;
    overflow: hidden;
}
.home-dashboard .home-command-palette[hidden] {
    display: none;
}
.home-dashboard .palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.home-dashboard .palette-shortcut-tip kbd {
    font-family: inherit;
    padding: 1px 5px;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    margin: 0 2px;
}
.home-dashboard .palette-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
}
.home-dashboard .palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.15s;
}
.home-dashboard .palette-item:hover,
.home-dashboard .palette-item.active {
    background: #e8eff8;
}
.home-dashboard .palette-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--home-card);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.home-dashboard .palette-item.active .palette-item-icon {
    background: var(--home-nav);
    color: var(--home-accent);
}
.home-dashboard .palette-item-main {
    flex: 1;
    min-width: 0;
}
.home-dashboard .palette-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--home-nav);
}
.home-dashboard .palette-item-desc {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-dashboard .palette-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.home-dashboard .palette-item-cat {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}
.home-dashboard .palette-enter-hint {
    font-size: 11px;
    color: var(--home-nav);
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s;
}
.home-dashboard .palette-item.active .palette-enter-hint,
.home-dashboard .palette-item:hover .palette-enter-hint {
    opacity: 1;
}

/* 快速分類篩選膠囊列 (Filter Chips) */
.home-dashboard .home-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.home-dashboard .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #c5c2ba;
    background: #ffffff;
    color: var(--home-nav);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.home-dashboard .filter-chip[hidden] {
    display: none;
}
.home-dashboard .filter-chip:hover {
    border-color: var(--home-nav);
    background: #eef3f9;
}
.home-dashboard .filter-chip.active {
    background: var(--home-nav);
    border-color: var(--home-nav);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(23, 58, 99, 0.2);
}
.home-dashboard .filter-chip.active i {
    color: var(--home-accent);
}
.home-dashboard .chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(23, 58, 99, 0.12);
    color: var(--home-nav);
}
.home-dashboard .filter-chip.active .chip-count {
    background: var(--home-accent);
    color: #173a63;
}

/* 1.2 常用功能置頂工作台 (Quick Workspace) */
.home-dashboard .home-quick-workspace {
    margin-bottom: 24px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #d5d1c8;
    box-shadow: 0 4px 16px rgba(23, 58, 99, 0.06);
}
.home-dashboard .home-quick-workspace[hidden] {
    display: none;
}
.home-dashboard .quick-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.home-dashboard .quick-workspace-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--home-nav);
}
.home-dashboard .quick-workspace-title i {
    color: #d97706;
    font-size: 17px;
}
.home-dashboard .quick-workspace-hint {
    font-size: 12px;
    font-weight: 500;
    color: #52677f;
    margin-left: 4px;
}
.home-dashboard .home-quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.home-dashboard .quick-empty-banner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #eef3f9;
    border: 1px dashed #94a3b8;
    color: #334155;
    font-size: 13px;
}
.home-dashboard .quick-empty-banner i {
    color: var(--home-nav);
    font-size: 16px;
}
.home-dashboard .quick-shortcut-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid var(--home-nav);
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s;
    flex: 0 1 180px;
    min-width: 165px;
}
.home-dashboard .quick-shortcut-card.is-pinned {
    border-color: var(--home-nav);
    background: #ffffff;
}
.home-dashboard .quick-shortcut-card:hover,
.home-dashboard .quick-shortcut-card:focus-visible {
    border-color: var(--home-accent);
    outline: 3px solid var(--home-accent);
    outline-offset: -3px;
    background: linear-gradient(135deg, #ffffff 0%, #fefce8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(23, 58, 99, 0.12);
}
.home-dashboard .quick-shortcut-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--home-card);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.home-dashboard .quick-shortcut-card.is-pinned .quick-shortcut-icon {
    background: var(--home-nav);
    color: var(--home-accent);
}
.home-dashboard .quick-shortcut-body {
    flex: 1;
    min-width: 0;
}
.home-dashboard .quick-shortcut-top {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 1px;
}
.home-dashboard .quick-shortcut-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--home-nav);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-dashboard .quick-shortcut-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
}
.home-dashboard .quick-category-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-dashboard .quick-pin-toggle {
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.home-dashboard .quick-pin-toggle.active {
    color: #eab308;
}
.home-dashboard .quick-pin-toggle:hover {
    color: #f59e0b;
    transform: scale(1.15);
}

/* 1.3 系統導航視覺化流程圖 (Interactive HR Flow) */
.home-dashboard .home-flow-section {
    margin-bottom: 28px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid #d5d1c8;
    box-shadow: 0 4px 16px rgba(23, 58, 99, 0.06);
}
.home-dashboard .home-flow-section[hidden] {
    display: none;
}
.home-dashboard .flow-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.home-dashboard .home-flow-section.collapsed .flow-section-header {
    margin-bottom: 0;
}
.home-dashboard .flow-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--home-nav);
}
.home-dashboard .flow-header-title i {
    color: var(--home-card);
    font-size: 17px;
}
.home-dashboard .flow-header-hint {
    font-size: 12px;
    font-weight: 500;
    color: #52677f;
    margin-left: 4px;
}
.home-dashboard .flow-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--home-nav);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.home-dashboard .flow-toggle-btn:hover {
    border-color: var(--home-nav);
    background: #eef3f9;
}
.home-dashboard .flow-toggle-btn i {
    transition: transform 0.25s ease;
}
.home-dashboard .home-flow-section.collapsed .flow-toggle-btn i {
    transform: rotate(180deg);
}
.home-dashboard .home-flow-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.home-dashboard .home-flow-body[hidden] {
    display: none;
}
.home-dashboard .flow-track {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.home-dashboard .flow-track-badge {
    flex: 0 0 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 10px;
    background: var(--home-nav);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
}
.home-dashboard .flow-track-badge i {
    font-size: 20px;
    color: var(--home-accent);
}
.home-dashboard .flow-track-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.home-dashboard .flow-steps-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.home-dashboard .flow-step-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.home-dashboard .flow-node {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid var(--home-nav);
    cursor: pointer;
    transition: all 0.2s;
}
.home-dashboard .flow-node:hover,
.home-dashboard .flow-node:focus-visible {
    border-color: var(--home-accent);
    outline: 3px solid var(--home-accent);
    outline-offset: -3px;
    background: linear-gradient(135deg, #ffffff 0%, #fefce8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(23, 58, 99, 0.12);
}
.home-dashboard .flow-node-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.home-dashboard .flow-node-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--home-card);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.home-dashboard .flow-node:hover .flow-node-icon,
.home-dashboard .flow-node:focus-visible .flow-node-icon {
    background: var(--home-nav);
    color: var(--home-accent);
}
.home-dashboard .flow-node-info {
    min-width: 0;
    flex: 1;
}
.home-dashboard .flow-node-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--home-nav);
    white-space: nowrap;
}
.home-dashboard .flow-node-add {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--home-nav);
    border: none;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(23, 58, 99, 0.2);
    transition: transform 0.15s, background 0.15s, color 0.15s;
}
.home-dashboard .flow-node-add:hover,
.home-dashboard .flow-node-add:focus-visible {
    background: var(--home-accent);
    color: var(--home-nav);
    transform: scale(1.12);
}
.home-dashboard .flow-connector {
    color: #64748b;
    font-size: 13px;
    flex-shrink: 0;
    padding: 0 2px;
}
.home-dashboard .flow-branches {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
}
.home-dashboard .flow-branch-label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.home-dashboard .flow-branch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--home-nav);
    color: var(--home-nav);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.home-dashboard .flow-branch-pill:hover,
.home-dashboard .flow-branch-pill:focus-visible {
    border-color: var(--home-accent);
    outline: 2px solid var(--home-accent);
    outline-offset: -2px;
    background: #fefce8;
}

/* 搜尋無結果提示 */
.home-dashboard .home-search-empty {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px dashed #94a3b8;
    border-radius: 16px;
    color: #334155;
}
.home-dashboard .home-search-empty[hidden] {
    display: none;
}
.home-dashboard .home-search-empty i {
    font-size: 36px;
    color: var(--home-nav);
    margin-bottom: 10px;
}
.home-dashboard .home-search-empty .empty-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--home-nav);
    margin-bottom: 6px;
}
.home-dashboard .home-search-empty .empty-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 14px;
}

/* 卡片頂部星號釘選列與搜尋高亮 */
.home-dashboard .dashboard-grid > .module-card.search-highlight {
    box-shadow: 0 0 0 3px var(--home-accent), 0 8px 20px rgba(20, 51, 88, 0.3) !important;
}
.home-dashboard .card-top-bar {
    position: absolute;
    top: 8px;
    left: 10px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 2;
}
.home-dashboard .card-pin-btn {
    pointer-events: auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 37, 64, 0.35);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}
.home-dashboard .card-pin-btn:hover {
    background: rgba(15, 37, 64, 0.65);
    color: #fde047;
    transform: scale(1.12);
}
.home-dashboard .card-pin-btn.active {
    background: rgba(15, 37, 64, 0.75);
    color: var(--home-accent);
}

/* 主管審核中心標題旁：未審加班單／未審請假單快捷標籤 */
.home-dashboard .manager-pending-badges {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    margin-bottom: 20px;
    vertical-align: middle;
    flex-wrap: wrap;
}
.home-dashboard .pending-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid var(--home-nav);
    color: var(--home-nav);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(23, 58, 99, 0.08);
    transition: all 0.2s ease;
}
.home-dashboard .pending-badge-link i {
    color: var(--home-card);
    font-size: 16px;
}
.home-dashboard .pending-badge-link.has-pending {
    border-color: #dc2626;
    background: #fff5f5;
}
.home-dashboard .pending-badge-link.has-pending i {
    color: #dc2626;
}
.home-dashboard .pending-badge-link:hover,
.home-dashboard .pending-badge-link:focus-visible {
    border-color: var(--home-accent);
    outline: 3px solid var(--home-accent);
    outline-offset: -3px;
    background: #fefce8;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(23, 58, 99, 0.14);
}
.home-dashboard .pending-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
}
.home-dashboard .pending-badge-link.has-pending .pending-badge-count {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

@media (max-width: 1200px) and (min-width: 769px) {
    .home-dashboard .flow-track { flex-direction: column; }
    .home-dashboard .flow-track-badge { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; padding: 8px 12px; }
    .home-dashboard .flow-steps-row { flex-wrap: wrap; gap: 8px; }
    .home-dashboard .flow-step-wrap { flex: 1 1 calc(33.333% - 8px); }
}

@media (max-width: 768px) {
    .home-dashboard .home-command-wrapper { max-width: 100%; flex: 1 1 100%; }
    .home-dashboard .cmd-kbd { display: none; }
    .home-dashboard .cmd-input { font-size: 14px; }
    .home-dashboard .palette-shortcut-tip { display: none; }
    .home-dashboard .palette-item-cat { display: none; }
    .home-dashboard .home-filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; -webkit-overflow-scrolling: touch; }
    .home-dashboard .filter-chip { flex-shrink: 0; padding: 6px 12px; font-size: 12px; }
    .home-dashboard .home-quick-workspace { padding: 12px; margin-bottom: 18px; }
    .home-dashboard .quick-workspace-hint { display: none; }
    .home-dashboard .home-quick-grid { gap: 8px; }
    .home-dashboard .quick-shortcut-card { flex: 1 1 calc(50% - 8px); min-width: 140px; padding: 8px; gap: 6px; }
    .home-dashboard .quick-shortcut-icon { width: 30px; height: 30px; font-size: 13px; }
    .home-dashboard .quick-shortcut-title { font-size: 13px; }
    .home-dashboard .home-flow-section { padding: 12px; margin-bottom: 18px; }
    .home-dashboard .flow-header-hint { display: none; }
    .home-dashboard .flow-track { flex-direction: column; padding: 10px; gap: 10px; }
    .home-dashboard .flow-track-badge { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; padding: 7px 12px; font-size: 13px; }
    .home-dashboard .flow-steps-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .home-dashboard .flow-step-wrap { width: 100%; }
    .home-dashboard .flow-node { width: 100%; padding: 10px 14px; }
    .home-dashboard .flow-connector { display: none; }
    .home-dashboard .card-top-bar { top: 4px; right: 4px; }
    .home-dashboard .card-pin-btn { width: 24px; height: 24px; font-size: 11px; }
    .home-dashboard .manager-pending-badges { display: flex; width: 100%; margin-left: 0; margin-top: -8px; margin-bottom: 16px; gap: 8px; }
    .home-dashboard .pending-badge-link { flex: 1 1 calc(50% - 8px); justify-content: center; padding: 8px 10px; font-size: 13px; }
}
