/* --------------- 頁面框架 --------------- */
:root {
    /* 柔和且高對比的配色 */
    --primary-light: #7EBFDA;
    /* 柔和水藍 */
    --primary-dark: #2B6CB0;
    /* 深藍（高對比） */
    --background-color: #F5F5F0;
    /* 米白色背景（護眼） */
    --card-background: #FFFFFF;
    --text-dark: #2D2D2D;
    /* 深灰（高對比） */
    --text-light: #555555;
    /* 中灰（提高對比） */
    --alert-critical: #D84315;
    /* 深橘紅（比純紅更柔和） */
    --alert-warning: #F57C00;
    /* 深橘色 */
    --success-color: #388E3C;
    /* 深綠色 */
    --border-radius-lg: 20px;
    --border-radius-sm: 10px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.15);
    --active-text: #1565C0;
    --sidebar-width: 340px;
    --topbar-height: 80px;
}

.hide-scrollbar {
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none !important;
}

body {
    font-family: '微軟正黑體', 'Arial', sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 18px;
}

/* ----------------------- 1. 左側選單 (Sidebar) ----------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(145deg, #E8F4F8 0%, #B8D4E6 100%);
    /* 柔和漸層 */
    color: var(--text-dark);
    padding: 30px 0;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar .accordion-button {
    border-radius: 5px;
}

.logo {
    font-size: 2.2em;
    font-weight: 800;
    margin: 0 25px 35px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-dark);
    color: var(--primary-dark);
    text-shadow: none;
}

/* 階層選單容器 */
.nav-container {
    list-style: none;
    width: 90%;
    margin: 8px auto;
}

/* 頂層分類標題 (可收合/展開) */
.nav-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 15px;
    font-size: 26px;
    /* 加大字體 */
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    border-bottom: 2px solid var(--primary-dark);
    background-color: rgba(255, 255, 255, 0.5);
    /* border-radius: var(--border-radius-sm); */
}

.nav-group-header i {
    transition: transform 0.3s;
    font-size: 1.4em;
    /* 加大圖示 */
}

.nav-group-header.collapsed i {
    transform: rotate(-90deg);
}

#sidebar_accordion {
    --bs-accordion-bg: transparent;
    --bs-accordion-active-bg: #ffffff;
    --bs-accordion-border-color: transparent;
}

/* 子選單列表 */
.sub-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.sub-nav-list.collapsed {
    max-height: 0;
}

/* 子選單項目 */
.sub-nav-item {
    width: 95%;
    display: flex;
    align-items: center;
    padding: 16px 18px;
    /* 增加內距 */
    margin: 4px 0;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1.15em;
    /* 加大字體 */
    transition: background-color 0.3s;
    background-color: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    font-weight: 500;
}

.sub-nav-item i {
    margin-right: 18px;
    font-size: 1.5em;
    /* 加大圖示 */
    color: var(--primary-dark);
}

.sub-nav-item.active {
    background-color: var(--card-background);
    color: var(--active-text);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    font-weight: 700;
    border: 2px solid var(--primary-dark);
}

.sub-nav-item:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-light);
}

/* 子子選單（sub-sub menu） */
.sub-nav-group {
    width: 95%;
    margin: 4px 0;
    list-style: none;
}

.sub-nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    transition: background-color 0.3s;
}

.sub-nav-group-toggle:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-light);
}

.sub-nav-group-toggle span {
    display: flex;
    align-items: center;
}

.sub-nav-group-toggle span i {
    margin-right: 18px;
    font-size: 1.5em;
    color: var(--primary-dark);
}

.sub-nav-arrow {
    font-size: 1.2em;
    transition: transform 0.3s;
    color: var(--primary-dark);
}

.sub-nav-group.open .sub-nav-arrow {
    transform: rotate(180deg);
}

.sub-sub-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.sub-nav-group.open .sub-sub-nav-list {
    max-height: 500px;
}

.sub-sub-nav-list .sub-nav-item {
    width: 100%;
    padding: 12px 18px 12px 56px;
    font-size: 1.05em;
    margin: 2px 0;
}

/* --- Sidebar 開合 --- */
.sidebar-toggle-btn {
    background: none;
    border: 2px solid var(--primary-dark);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-dark);
    transition: all 0.3s;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: var(--primary-dark);
    color: #fff;
}
.sidebar-expand-btn {
    background: none;
    border: 2px solid var(--primary-dark);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary-dark);
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-expand-btn:hover {
    background: var(--primary-dark);
    color: #fff;
}
.sidebar.sidebar-collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    min-width: 0;
}
.sidebar {
    transition: width 0.3s ease, padding 0.3s ease;
}

/* ----------------------- 2. 右側主內容區 ----------------------- */
.main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 2.1 頂部資訊列 */
.top-info-bar {
    height: var(--topbar-height);
    background-color: var(--card-background);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 0 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 1.15em;
    /* 加大字體 */
}

.user-detail {
    color: var(--text-dark);
    font-weight: 600;
}

.user-detail strong {
    color: var(--primary-dark);
    font-weight: 800;
    margin-right: 8px;
}

.logout-btn {
    background-color: var(--alert-critical);
    color: white;
    padding: 14px 24px;
    /* 增大按鈕 */
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
    font-size: 1.1em;
    /* 加大字體 */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.logout-btn:hover {
    background-color: #BF360C;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.logout-btn i {
    margin-right: 8px;
    font-size: 1.3em;
}

/* 2.2 主內容區 */
.main-content {
    padding: 35px;
    overflow-y: auto;
    flex-grow: 1;
}

.page-title {
    font-size: 2.3em;
    /* 加大標題 */
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 35px;
    border-left: 6px solid var(--primary-dark);
    padding-left: 20px;
}

/* 儀表板卡片佈局 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 35px;
}

.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: 35px;
    box-shadow: var(--shadow-soft);
    border: 2px solid #E0E0E0;
}

.card h3 {
    font-size: 1.7em;
    /* 加大標題 */
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-light);
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    font-weight: 800;
}

.card h3 i {
    margin-right: 12px;
    font-size: 1.4em;
}

/* 告警區塊 */
.alert-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.alert-item {
    padding: 25px;
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.alert-item.critical {
    background-color: var(--alert-critical);
}

.alert-item.warning {
    background-color: var(--alert-warning);
}

.alert-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.35em;
    /* 加大字體 */
}

.alert-item-header i {
    font-size: 1.4em;
}

.alert-item small {
    display: block;
    font-size: 1em;
    margin-bottom: 8px;
    font-weight: 500;
}

.alert-item p {
    font-size: 1.1em;
    /* 加大字體 */
    margin: 8px 0 0;
    font-weight: 700;
    opacity: 1;
}

.alert-action {
    display: block;
    margin-top: 18px;
    text-align: right;
    font-size: 1.05em;
    /* 加大字體 */
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.alert-action:hover {
    opacity: 0.8;
}

/* 訊息列表 */
.message-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.message-item {
    padding: 20px 0;
    border-bottom: 2px dashed #CCC;
    display: flex;
    align-items: center;
}

.message-item:last-child {
    border-bottom: none;
}

.message-item i {
    margin-right: 18px;
    color: var(--primary-dark);
    font-size: 2em;
    /* 加大圖示 */
    flex-shrink: 0;
}

.message-content strong {
    display: block;
    font-size: 1.15em;
    /* 加大字體 */
    margin-bottom: 5px;
    color: var(--text-dark);
    font-weight: 700;
}

.message-content small {
    color: var(--text-light);
    font-size: 1em;
    /* 加大字體 */
    line-height: 1.5;
}

/* 新個案通知 */
.new-case-item {
    padding: 20px 0;
    border-bottom: 2px dashed #CCC;
}

.new-case-item:last-child {
    border-bottom: none;
}

.new-case-item strong {
    display: block;
    font-size: 1.25em;
    /* 加大字體 */
    color: var(--success-color);
    margin: 8px 0;
    font-weight: 800;
}

.new-case-item small {
    color: var(--text-light);
    font-size: 1.05em;
    /* 加大字體 */
    line-height: 1.6;
    display: block;
    margin: 5px 0;
    font-weight: 500;
}

.new-case-action {
    background-color: var(--primary-dark);
    color: white;
    padding: 12px 20px;
    /* 增大按鈕 */
    border-radius: 8px;
    margin-top: 12px;
    display: inline-block;
    cursor: pointer;
    font-size: 1.05em;
    /* 加大字體 */
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.new-case-action:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

/* --------------- 頁面框架 --------------- */

/* --------------- 企業總覽 --------------- */
.container {
    max-width: 100%;
    margin: 0 auto;
}

/* 篩選與報表區塊 (參考截圖中的 "打卡紀錄查詢與匯出" 區塊) */
.control-panel-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    border: 1px solid #cce5ff;
    /* 淺藍色邊框，增加區塊感 */
}

.control-panel-header {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
    /* 藍色標題 */
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
}

.control-panel-header::before {
    content: '🗓️';
    margin-right: 10px;
    font-size: 20px;
}

.control-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #495057;
}

.date-input-group label {
    font-weight: 600;
}

.date-input-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: #fff;
}

.date-input-group input[type="date"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 匯出按鈕 (參考截圖中的綠色按鈕) */
.export-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #28a745;
    /* 綠色 */
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.export-button:hover {
    background-color: #218838;
}

.export-button:active {
    transform: scale(0.99);
}

/* --- KPI 卡片樣式 (與原 HTML 相同) --- */
.kpi-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 20px;
}

.kpi-card {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.kpi-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 32px;
    font-weight: bold;
    color: #007bff;
}

.kpi-card:nth-child(2) .kpi-value {
    color: #28a745;
}

.kpi-card:nth-child(3) .kpi-value {
    color: #ffc107;
}

.kpi-card:nth-child(4) .kpi-value {
    color: #dc3545;
}

/* --- 圖表網格與卡片樣式 (與原 HTML 相同) --- */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.chart-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

h2 {
    font-size: 20px;
    color: #343a40;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 模擬圖表樣式 (與原 HTML 相同，僅用於展示佈局) */
.chart-bar-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #f8f9fa 1px, transparent 1px);
    background-size: 100% 50px;
    padding: 10px 0;
}

.bar-container {
    display: flex;
    align-items: flex-end;
    height: 250px;
    gap: 10px;
    padding: 0 20px;
    border-left: 1px solid #ced4da;
    border-bottom: 1px solid #ced4da;
}

.bar-group {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bar-group div {
    width: 20px;
    margin-top: auto;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s;
}

.bar-group .bar-scheduled {
    background-color: #007bff;
    height: 75%;
    opacity: 0.8;
}

.bar-group .bar-served {
    background-color: #28a745;
    height: 70%;
    margin-left: -5px;
    opacity: 0.8;
}

.bar-group::after {
    content: ' ';
    position: absolute;
    top: 15%;
    width: 100%;
    height: 5%;
    background-color: rgba(220, 53, 69, 0.3);
}

.chart-donut {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: conic-gradient(#007bff 0% 30%, #ffc107 30% 55%, #28a745 55% 70%, #dc3545 70% 85%, #6c757d 85% 100%);
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 5px solid #f4f7f9;
}

.donut-center-text {
    font-size: 16px;
    font-weight: bold;
    color: #343a40;
}

.chart-scatter {
    width: 100%;
    height: 100%;
    position: relative;
    border-left: 1px solid #ced4da;
    border-bottom: 1px solid #ced4da;
    background-color: #f8f9fa;
}

.scatter-point {
    position: absolute;
    border-radius: 50%;
    background-color: #ff6f61;
    opacity: 0.7;
    border: 1px solid white;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.p1 {
    top: 70%;
    left: 10%;
    width: 15px;
    height: 15px;
    background-color: #007bff;
}

.p2 {
    top: 55%;
    left: 25%;
    width: 25px;
    height: 25px;
    background-color: #007bff;
}

.p3 {
    top: 40%;
    left: 40%;
    width: 35px;
    height: 35px;
    background-color: #dc3545;
}

.p4 {
    top: 65%;
    left: 60%;
    width: 10px;
    height: 10px;
}

.p5 {
    top: 20%;
    left: 75%;
    width: 20px;
    height: 20px;
    background-color: #dc3545;
}

.p6 {
    top: 30%;
    left: 15%;
    width: 5px;
    height: 5px;
}

.p7 {
    top: 80%;
    left: 85%;
    width: 30px;
    height: 30px;
}

.area-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.area-segment {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0% 100%, 15% 70%, 30% 85%, 50% 50%, 70% 60%, 85% 35%, 100% 45%, 100% 100%);
    opacity: 0.7;
}

.area-revenue {
    background: linear-gradient(to top, #ffc107, #ff9800);
    height: 70%;
}

.area-time {
    background: linear-gradient(to top, #007bff, #0056b3);
    clip-path: polygon(0% 100%, 15% 90%, 30% 75%, 50% 60%, 70% 50%, 85% 25%, 100% 35%, 100% 100%);
    height: 50%;
    opacity: 0.8;
}

/* --------------- 企業總覽 --------------- */



/* --------------- 登入畫面 --------------- */
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: '微軟正黑體', 'Arial', sans-serif;
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background: linear-gradient(145deg, #E8F4F8 0%, #B8D4E6 100%);
}

.login-card {
    background-color: var(--card-background, #ffffff);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 50px 40px;
    width: 400px;
    text-align: center;
}

.login-card h1 {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--primary-dark, #2B6CB0);
    margin-bottom: 10px;
}

.login-card p {
    font-size: 1em;
    color: var(--text-light, #555555);
    margin-bottom: 35px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark, #2D2D2D);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9ff;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-dark, #2B6CB0);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(43, 108, 176, 0.25);
}

.login-button {
    background-color: var(--primary-dark, #2B6CB0);
    color: white;
    padding: 14px;
    font-size: 1.1em;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s, transform 0.2s;
}

.login-button:hover {
    background-color: #1a4f94;
    transform: translateY(-2px);
}

.login-button:active {
    transform: scale(0.98);
}

/* --------------- 登入畫面 --------------- */

:root {
    --primary-color: #2B6CB0;
    /* 深藍色 */
    --secondary-color: #7EBFDA;
    /* 淺藍色 */
    --background-color: #F5F5F0;
    /* 米白色背景 */
    --card-background: #FFFFFF;
    --text-dark: #2D2D2D;
    /* 深灰 */
    --text-light: #555555;
    /* 中灰 */
    --indicator-in-service: #388E3C;
    /* 服務中 (深綠) */
    --indicator-late: #F57C00;
    /* 遲到/異常 (深橘) */
    --indicator-off: #757575;
    /* 離線/未打卡 (深灰) */
    --alert-color: #D84315;
    /* 深橘紅 */
    --border-radius-lg: 20px;
    --border-radius-sm: 10px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.15);
    --active-text: #1565C0;
}

/* --------------- 案家資訊 --------------- */
/* 頂部控制欄 */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background-color: var(--card-background);
    padding: 20px 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    border: 2px solid #E0E0E0;
}

.top-controls h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 2em;
    /* 加大標題 */
    font-weight: 800;
}

.region-selector label {
    font-size: 1.2em;
    /* 加大字體 */
    color: var(--text-dark);
    font-weight: 700;
    margin-right: 15px;
}

.region-selector select {
    padding: 12px 40px 12px 20px;
    /* 增大內距 */
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--primary-color);
    font-size: 1.15em;
    /* 加大字體 */
    background-color: white;
    color: var(--primary-color);
    font-weight: 700;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232B6CB0%22%20d%3D%22M287%2069.4L146.2%20208.7L5.4%2069.4h281.6z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 15px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* 新增：過濾條件區 */
.filter-section {
    background-color: var(--card-background);
    padding: 20px 25px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 25px;
    border: 2px solid #E0E0E0;
}

.filter-section h3 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: 800;
    display: flex;
    align-items: center;
}

.filter-section h3 i {
    margin-right: 10px;
    font-size: 1.3em;
}

.filter-controls {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-item label {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}

.filter-item select {
    padding: 10px 35px 10px 15px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--primary-color);
    font-size: 1.1em;
    background-color: white;
    color: var(--primary-color);
    font-weight: 600;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232B6CB0%22%20d%3D%22M287%2069.4L146.2%20208.7L5.4%2069.4h281.6z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px;
    cursor: pointer;
    min-width: 200px;
}

/* 新增：打卡紀錄功能區 */
.attendance-section {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 25px;
    border: 2px solid #E0E0E0;
}

.attendance-section h3 {
    margin: 0 0 20px 0;
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: 800;
    display: flex;
    align-items: center;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
}

.attendance-section h3 i {
    margin-right: 10px;
    font-size: 1.3em;
}

.date-filter-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input-group label {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text-dark);
}

.date-input-group input[type="date"] {
    padding: 10px 15px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--primary-color);
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}

.export-button {
    background-color: var(--indicator-in-service);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.15em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.export-button:hover {
    background-color: #2E7D32;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.export-button i {
    font-size: 1.3em;
}

/* 查詢按鈕樣式 */
.query-button {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.15em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.query-button:hover {
    background-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.query-button i {
    font-size: 1.3em;
}

/* 儀表板卡片佈局 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    flex-grow: 1;
}

/* 概況小卡片區 */
.summary-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.summary-card {
    background: linear-gradient(145deg, #E8F4F8 0%, #B8D4E6 100%);
    color: var(--primary-color);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    text-align: center;
    flex-grow: 1;
    border: 2px solid var(--primary-color);
}

.summary-card.alt {
    background: var(--card-background);
    color: var(--text-dark);
    border: 2px solid var(--secondary-color);
}

.summary-card .value {
    font-size: 3.2em;
    /* 加大數字 */
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
    color: inherit;
}

.summary-card .label {
    font-size: 1.3em;
    /* 加大標籤 */
    font-weight: 700;
    color: inherit;
}

/* 主要資訊卡片 */
.main-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    flex-grow: 1;
    border: 2px solid #E0E0E0;
}

.main-card h3 {
    font-size: 1.6em;
    /* 加大標題 */
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 12px;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    font-weight: 800;
}

.main-card h3 i {
    margin-right: 12px;
    font-size: 1.3em;
}

.main-card h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 800;
}

/* 新增：地圖標記開關區塊 */
.map-toggle-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--background-color);
    /* 使用米白色背景，與整體協調 */
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    /* 與地圖區隔開 */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #D0D0D0;
    flex-wrap: wrap;
    /* 應對小螢幕 */
}

/* 複選框樣式 */
.map-toggle-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.2s;
}

.map-toggle-item:hover {
    color: var(--primary-color);
}

.map-toggle-item input[type="checkbox"] {
    /* 隱藏原生複選框 */
    display: none;
}

/* 模擬複選框的標記 */
.map-toggle-item span {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    background-color: white;
    flex-shrink: 0;
}

/* 選中時的勾選樣式 */
.map-toggle-item input[type="checkbox"]:checked+span:after {
    content: '✔';
    position: absolute;
    top: -2px;
    left: 2px;
    font-size: 18px;
    color: var(--indicator-in-service);
    /* 使用服務中綠色作為勾選色 */
    font-weight: 900;
}

/* 標記的圖標 */
.map-toggle-item i {
    font-size: 1.3em;
    margin-right: 5px;
    color: var(--primary-color);
}

/* 地圖模擬卡片 */
.map-placeholder {
    min-height: 250px;
    /* 調整高度以容納新區塊 */
    background-color: #E8F4F8;
    border-radius: var(--border-radius-sm);
    margin-top: 0;
    /* 確保緊貼上方開關區 */
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary-color);
    color: var(--text-dark);
    font-style: italic;
    font-size: 1.2em;
    font-weight: 600;
}

/* 居服員狀態列表 */
.worker-status-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 30px;
}

.worker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 2px dashed #CCC;
}

.worker-info {
    display: flex;
    align-items: center;
}

.worker-info i {
    font-size: 1.8em;
    /* 加大圖示 */
    margin-right: 12px;
    color: var(--text-dark);
}

.worker-info span {
    font-size: 1.15em;
    /* 加大姓名 */
    font-weight: 700;
}

.status-tag {
    padding: 8px 14px;
    /* 增大標籤 */
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: 700;
    font-size: 1em;
    /* 加大字體 */
    white-space: nowrap;
}

.tag-in-service {
    background-color: var(--indicator-in-service);
}

.tag-late {
    background-color: var(--indicator-late);
}

.tag-offline {
    background-color: var(--indicator-off);
}

/* 案家資訊的模擬圖表樣式（避免覆蓋企業總覽的 .chart-placeholder） */
.main-card .chart-placeholder {
    height: 180px;
    background-color: #F8FCFF;
    border-radius: var(--border-radius-sm);
    border: 2px dashed var(--primary-color);
    justify-content: center;
    align-items: center;
    color: var(--text-dark);
    font-size: 1.15em;
    font-weight: 600;
}