/* backend/static/css/admin-style.css */
/* Admin Page Specific Styles */

/* 確保 header 不會裁切掉彈出的下拉選單 */
.admin-header {
    position: relative; /* 為了讓 z-index 生效 */
    z-index: 1040;      /* 設定一個比內容區塊高的層級，但比彈出視窗低 */
}
.admin-section {
    padding: 40px 0;
    background-color: #fff;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-section h2 {
    text-align: center;
    font-size: 3em;
    color: #0ABAB5; /* Tiffany 藍 */
    margin-top: 0;
    margin-bottom: 30px;
}

.admin-form-container {
    background-color: #f7f7f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.admin-form-container h3 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8em;
    color: #333;
}

#add-employee-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#add-employee-form .form-group,
#edit-employee-form .form-group {
    display: flex;
    flex-direction: column;
    margin: 0;
}

#add-employee-form label,
#edit-employee-form label {
    margin-bottom: 8px;
    font-weight: bold;
    text-align: left;
}

#add-employee-form input[type="text"],
#add-employee-form input[type="password"],
#edit-employee-form input[type="text"],
#edit-employee-form input[type="password"] {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#add-employee-form button,
#edit-employee-form button {
    margin-top: 10px;
    padding: 12px;
    font-size: 1.1em;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions .btn {
    margin: 0 5px;
}

/* Checkbox style for edit form */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

/* --- 表單元素樣式 --- */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* 關鍵：確保 padding 不會影響寬度 */
    height: 42px; /* 【解決方案 #4】統一高度 */
}
.form-group textarea {
    height: auto; /* Textarea 高度自適應 */
    min-height: 80px;
}

#edit-employee-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.order-filter-sort {
    text-align: left;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
}

.order-filter-sort label {
    font-weight: bold;
    color: #555;
}

.order-filter-sort select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95em;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px;
}

.order-filter-sort input[type="date"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95em;
    background-color: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/cline%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/cline%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/cline%3e%3c/svg%3e"); /* 日曆圖標 */
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 35px;
}

.order-filter-sort #refresh-orders-btn {
    margin-left: auto;
    margin-top: 0;
}

.orders-list {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.orders-list p {
    text-align: center;
    color: #999;
    padding: 20px;
}

.order-date-group {
    background-color: #e0f2f1;
    padding: 10px 20px;
    margin-top: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    grid-column: 1 / -1;
}

.order-date-group h3 {
    font-size: 1.8em;
    color: #0ABAB5;
    margin: 0;
}

.order-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.order-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;    
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.order-header h3 {
    font-size: 1.5em;
    color: #333;
    margin: 0;
}

.order-header span {
    font-size: 1.1em;
    font-weight: bold;
    color: #0ABAB5;
}

.order-details p {
    margin: 2px 0;
    font-size: 1em;
    color: #555;
    text-align: left;
}

.order-details ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    border-top: 1px dashed #ddd;
    padding-top: 10px;
}

.order-details ul li {
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.95em;
    color: #666;
    border-bottom: 1px dotted #eee;
}

.order-details ul li:last-child {
    border-bottom: none;
}

.order-details .total-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #e44d26;
    text-align: right;
    margin-top: 10px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.details-collapsible {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dotted #ccc;
}

.toggle-details-btn {
    background: none;
    border: none;
    color: #0ABAB5;
    text-decoration: underline;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 10px;
    font-size: 0.9em;
}
.toggle-details-btn:hover {
    color: #089A94;
}

.order-status-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    gap: 10px;
    align-items: center;
}

.status-update-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.status-line p,
.status-line label {
    margin: 0;
    white-space: nowrap;
}

.order-status-select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #fff;
    cursor: pointer;
    flex-grow: 1;
}

.order-status-section .update-status-btn {
    align-self: stretch;
    margin: 0;
    padding: 10px 20px;
    font-size: 1em;
}

/* 付款狀態區域 */
.payment-status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.payment-status-section p {
    margin: 0;
    flex: 1;
    font-size: 1em;
    font-weight: normal;
}

.current-payment-status {
    font-weight: bold;
}

.current-payment-status[data-payment-status="Paid"] {
    color: #28a745;
}

.current-payment-status[data-payment-status="Unpaid"] {
    color: #dc3545;
}

.mark-paid-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.mark-paid-btn:hover {
    background-color: #218838;
}

/* 付款方式控制區域 */
.payment-method-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.payment-method-controls p {
    margin: 0;
    font-size: 1em;
    font-weight: normal;
}

.payment-method-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.payment-method-select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    min-width: 120px;
}

.payment-method-select:focus {
    outline: 0;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.update-payment-method-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.update-payment-method-btn:hover {
    background-color: #5a6268;
}

.update-payment-method-btn:disabled {
    background-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-status-display {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

/* 響應式設計 - 小螢幕調整 */
@media (max-width: 768px) {
    .payment-method-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .payment-method-select {
        min-width: auto;
        width: 100%;
    }
    
    .update-payment-method-btn {
        width: 100%;
        margin-top: 5px;
    }
}

.mark-paid-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* 退款相關樣式 */
.refund-section {
    margin-top: 12px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
}

.refund-status-display {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.refund-status {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.refund-status.none {
    color: #6c757d;
}

.refund-status.partial {
    color: #fd7e14;
    background-color: #fff3cd;
}

.refund-status.full {
    color: #28a745;
    background-color: #d4edda;
}

.refund-status.processing {
    color: #007bff;
    background-color: #cce7ff;
}

.refund-status.failed {
    color: #dc3545;
    background-color: #f8d7da;
}

.refund-amount {
    margin-left: 8px;
    font-weight: normal;
    color: #495057;
}

.refund-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.refund-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.refund-btn:hover {
    background-color: #c82333;
}

.refund-btn:disabled {
    background-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.partial-refund-btn {
    background-color: #fd7e14;
}

.partial-refund-btn:hover {
    background-color: #e96900;
}

.retry-refund-btn {
    background-color: #17a2b8;
}

.retry-refund-btn:hover {
    background-color: #138496;
}

.refund-processing {
    margin: 8px 0;
    color: #007bff;
    font-weight: bold;
    font-size: 14px;
}

.refund-failed {
    margin: 8px 0;
    color: #dc3545;
    font-weight: bold;
    font-size: 14px;
}

/* 響應式設計 - 退款按鈕 */
@media (max-width: 768px) {
    .refund-controls {
        flex-direction: column;
    }
    
    .refund-btn {
        width: 100%;
        margin-bottom: 4px;
    }
}

.order-card-id {
    font-size: 1.2em;
    color: #555;
    font-weight: bold;
}

.order-card-total {
    font-size: 1.4em;
    font-weight: bold;
    color: #0ABAB5;
}

.order-card-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.order-card-footer .btn {
    flex: 1;
    font-size: 1em;
    padding: 10px;
    display: none; /* 隱藏按鈕 */
}

.update-status-btn {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    align-self: stretch;
    padding: 10px 20px;
    font-size: 1em;
    margin-top: 0; 
}

.order-status-section .current-order-status {
    font-weight: bold;
    color: #0ABAB5;
}

.current-order-status[data-status="Pending"] { color: orange; }
.current-order-status[data-status="Unpaid"] { color: #8B4513; }
.current-order-status[data-status="Processing"] { color: #0ABAB5; }
.current-order-status[data-status="Completed"] { color: green; }
.current-order-status[data-status="Cancelled"] { color: red; }


/* ======================================================= */
/* == 【修改後】統一後台所有彈出視窗 (Modal) 的樣式 == */
/* ======================================================= */

/* 彈出視窗的背景遮罩層 (適用於 #edit-item-modal, #recipe-editor-modal 等) */
.modal, .pos-modal {
    display: none; /* 預設隱藏，由 JS 的 .active 或 style.display='flex'/'block' 控制 */
    position: fixed;                                                                                                                             
    left: 0;                                                                                                                                                       
    top: 0;                                                                                                                                                         
    width: 100%;                                                                                                                                                    
    height: 100%;                                                                                                                                                   
    background-color: rgba(0,0,0,0.6);                                                                                                                              
    /* 使用 Flexbox 實現置中 */                                                                                                                                     
    justify-content: center;                                                                                                                                        
    align-items: center;                                                                                                                                            
    padding: 15px; /* 在螢幕邊緣提供一些緩衝 */                                                                                                                     
    box-sizing: border-box;
    z-index: 1060; /* 確保在頂層，高於 Bootstrap 預設遮罩 */
}

/* 激活彈窗時的顯示方式 */
.modal.active, .pos-modal.active {
    display: flex;
}

/* 彈出視窗的內容框 */
.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    width: 100%; /* 先佔滿父容器（有 padding 的 .modal） */
    max-width: 500px; /* 預設最大寬度 */
    max-height: 90vh; /* 最大高度為視窗的 90% */
    overflow-y: auto; /* 內容超出時，垂直滾動 */
    position: relative; /* 為了關閉按鈕的絕對定位 */
    box-sizing: border-box; /* padding 不會撐大寬度 */
    margin: 0; /* 覆蓋舊的 margin */
    border: none; /* 覆蓋舊的 border */
}

/* 為特定 modal 設定背景色 */
#edit-item-modal .modal-content {
    background-color: #f7f7f9;
}

/* 特別為配方編輯器加大寬度 */
#recipe-editor-modal .modal-content {
    max-width: 750px;
}

/* 關閉按鈕 (X) */
.close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #333;
}

/* 彈出視窗的標題 (H3) */
.modal h3, .pos-modal h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.8em;
    color: #0ABAB5;
    text-align: center;
}

.modal-footer {
    text-align: center;
    margin-top: 30px;
}

.modal-footer .close-button-bottom {
    padding: 10px 20px;
    font-size: 1.1em;
}

/* --- 通用內容區塊手機邊距優化 --- */
@media (max-width: 768px) {
    .content, .content-block, .admin-form-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* 【新增】讓配方表單在手機上更友好 */
    #recipe-editor-modal .inline-form {
        flex-direction: column; /* 垂直堆疊 */
        align-items: stretch; /* 元素拉伸至全寬 */
    }

    #recipe-editor-modal .inline-form .btn {
        width: 100%;
    }
    
    /* 讓配方表格可以水平滾動 */
    #recipe-editor-modal .table-container {
        overflow-x: auto;
    }
}


/* 營業額統計樣式 */
.sales-results-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-top: 20px;
    text-align: left;
}

.sales-results-container h3 {
    color: #0ABAB5;
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
}

.sales-results-container p {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
}

.sales-results-container strong {
    color: #e44d26;
}

.sales-results-container h4 {
    font-size: 1.5em;
    color: #0ABAB5;
    margin-top: 25px;
    margin-bottom: 10px;
    border-top: 1px dashed #eee;
    padding-top: 15px;
}

.sales-results-container ul {
    list-style: none;
    padding: 0;
}

.sales-results-container ul li {
    padding: 5px 0;
    font-size: 1em;
    color: #555;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.sales-summary-cards {
    margin-top: 20px;
    margin-bottom: 30px;
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
}

.summary-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.2s ease-in-out;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.dashboard-card-link {
    text-decoration: none;
    color: inherit; 
    display: block; 
    width: 100%; 
    height: 100%; 
}

.summary-card h3 {
    font-size: 1.6em;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.summary-card p { 
    font-size: 2.2em;
    color: #0ABAB5;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-summary-cards .summary-card {
    padding: 20px;
}

.sales-summary-cards .summary-card .main-revenue-display {
    font-size: 2.8em;
    color: #0ABAB5;
    font-weight: bold;
}

.daily-sales-list-container {
    max-height: 250px;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 15px 20px;
    margin-top: 20px;
    text-align: left;
}

.daily-sales-list-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.daily-sales-list-container ul li {
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
    font-size: 1.1em;
    color: #555;
}

.daily-sales-list-container ul li:last-child {
    border-bottom: none;
}

.daily-sales-title {
    font-size: 1.5em;
    color: #0ABAB5;
    margin-top: 25px;
    margin-bottom: 15px;
    text-align: center;
}

.sales-chart-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-top: 30px;
    position: relative;
    height: 400px;
    max-height: 500px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sales-chart-container h3 {
    color: #0ABAB5;
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
}

#salesChart {
    width: 100% !important; 
    height: 100% !important; 
    max-height: 350px; 
}

#no-chart-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: #999;
}

.sales-summary-cards .summary-card:hover {
    transform: translateY(-5px);
}

.sales-summary-cards .summary-card h3 {
    font-size: 1.6em;
    color: #333;
    margin-bottom: 5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.sales-summary-cards .summary-card .main-revenue-display {
    font-size: 2.8em;
    color: #0ABAB5;
    font-weight: bold;
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-summary-cards .summary-card p {
    font-size: 2.2em;
    font-weight: bold;
    color: #e44d26;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-form-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 25px;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.expense-form-container h3 {
    color: #0ABAB5;
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.expense-form-container .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.expense-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.expense-form-container input[type="date"],
.expense-form-container input[type="number"],
.expense-form-container select,
.expense-form-container textarea {
    width: 100%; 
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

.expense-form-container textarea {
    resize: vertical;
}

.expense-form-container .btn {
    width: auto;
    padding: 10px 30px;
    font-size: 1.1em;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#expenses-summary {
    margin-top: 40px;
    text-align: center;
}

#expenses-summary h3 {
    color: #0ABAB5;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
}

#expenses-summary p {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #333;
}

#expenses-summary strong {
    color: #e44d26;
}

.expenses-detail-list {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 15px 20px;
    margin-top: 20px;
    max-height: 350px;
    overflow-y: auto;
    text-align: left;
}

.expenses-detail-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.expenses-detail-list ul li {
    padding: 10px 0;
    border-bottom: 1px dotted #eee;
    font-size: 1em;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.expenses-detail-list ul li:last-child {
    border-bottom: none;
}

.expenses-detail-list ul li span:first-child {
    font-weight: bold;
    color: #0ABAB5;
    margin-bottom: 5px;
}

.expenses-detail-list ul li span:last-child {
    font-size: 1.1em;
    color: #e44d26;
    margin-top: 5px;
}

.expenses-detail-list ul li p {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
    margin-bottom: 0;
}

.expenses-layout-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-top: 20px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .expenses-layout-grid {
        grid-template-columns: 1fr;
    }
}

.expenses-summary-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    min-height: 400px;
}

#expenses-summary-cards {
    margin-top: 0; 
    margin-bottom: 0;
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
}

#expenses-summary-cards .summary-card {
    padding: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#expenses-summary-cards .summary-card h3 {
    font-size: 1.6em;
    color: #333;
    margin-bottom: 10px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
#expenses-summary-cards .summary-card p {
    font-size: 2.2em;
    font-weight: bold;
    color: #e44d26;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#expenses-summary-cards .summary-card .main-revenue-display {
    color: #0ABAB5;
    font-size: 3.2em;
}

#expenses-list.daily-sales-list-container {
    margin-top: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.expenses-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
}
.expenses-detail-list h4 {
    margin-bottom: 10px;
    text-align: left;
}
.expenses-detail-list > p {
    text-align: center;
    color: #999;
    padding: 20px;
}

.expenses-dashboard-widgets.sales-chart-container { 
    margin-top: 30px; 
    grid-column: 1 / -1;
}

#expensesChart {
    width: 100% !important;
    height: 100% !important;
    max-height: 300px;
}

#no-expenses-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: #999;
}

.item-customizations {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
    background-color: #f9f9f9;
    border-left: 3px solid #0ABAB5;
    padding-top: 5px;
    padding-bottom: 5px;
}

.item-customizations li {
    padding: 2px 0;
    border: none;
    display: block;
}

.order-summary-line {
    font-weight: bold;
    color: #333;
    background-color: #e0f7f6;
    padding: 8px 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.employee-layout-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: flex-start;
}

.employee-form-container {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.employee-form-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    color: #0ABAB5;
}

#employee-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#employee-table th, #employee-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

#employee-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

#employee-table .btn-sm {
    padding: 5px 10px;
    font-size: 0.9em;
}

@media (max-width: 900px) {
    .employee-layout-grid {
        grid-template-columns: 1fr;
    }
}

.report-filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.report-table-container {
    overflow-x: auto;
}

#time-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#time-report-table th, #time-report-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
}

#time-report-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

#time-report-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.deduction-note {
    font-size: 0.8em;
    color: #888;
    margin-left: 5px;
    font-style: italic;
    white-space: nowrap;
}

#time-report-table tfoot td {
    background-color: #e9ecef;
    font-weight: bold;
    font-size: 1.1em;
    text-align: right;
    padding-right: 20px;
}

#time-report-table tfoot td:last-child {
    text-align: left;
    color: #007bff;
}

header nav li.dropdown {
    position: relative;
}

header nav li.dropdown .dropdown-toggle::after {
    content: ' ▾';
    font-size: 0.8em;
}

header nav ul.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    padding: 10px 0;
    list-style: none;
    min-width: 160px;
    z-index: 1000;
}

header nav ul.dropdown-menu li {
    padding: 0;
}

header nav ul.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
}

@media (min-width: 769px) {
    header nav li.dropdown:hover > ul.dropdown-menu {
        display: block;
    }
}

@media (max-width: 992px) {
    .admin-header .container {
        justify-content: space-between;
    }

    .admin-header .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1101;
    }
    
    .admin-header .hamburger-btn .hamburger-icon-bar {
        width: 100%;
        height: 3px;
        background-color: #333;
        border-radius: 5px;
        transition: all 0.3s ease-in-out;
    }

    .admin-header .hamburger-btn.is-active {
        position: fixed;
        right: 20px;
        top: 28px;
    }

    .admin-header .hamburger-btn.is-active .hamburger-icon-bar {
        background-color: #333;
    }

    .admin-header .hamburger-btn.is-active .hamburger-icon-bar:nth-child(1) { transform: translateY(11px) rotate(45deg); }
    .admin-header .hamburger-btn.is-active .hamburger-icon-bar:nth-child(2) { opacity: 0; }
    .admin-header .hamburger-btn.is-active .hamburger-icon-bar:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

    #admin-main-nav {
        position: fixed;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        z-index: 1100;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: left 0.4s ease-in-out;
        overflow-y: auto; /* 新增：允許垂直滾動 */
    }

    #admin-main-nav.is-active {
        left: 0;
    }

    #admin-main-nav ul {
        flex-direction: column;
        text-align: center;
    }

    #admin-main-nav ul li {
        padding: 15px 0;
    }

    #admin-main-nav ul li a {
        font-size: 1.5em;
        font-weight: 500;
    }

    #admin-main-nav .dropdown-menu {
        display: none;
        position: static;
        background: none;
        box-shadow: none;
        border: none;
        padding-top: 15px;
    }

    #admin-main-nav .dropdown-menu.is-open {
        display: block;
    }

    #admin-main-nav .dropdown-menu li a {
        font-size: 0.8em;
        color: #555;
    }
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0ABAB5;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:not(:checked) + .slider {
    background-color: #f44336;
}

.admin-table td, .admin-table th {
    padding: 8px;
    text-align: center;
}

.actions .btn {
    margin: 2px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 15px;
}

.inline-form .form-group {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
}

.inline-form .form-group.full-width {
    flex-basis: 100%;
}

.inline-form label {
    margin-bottom: 6px;
    font-size: 0.9em;
    font-weight: 500;
    color: #495057;
}

.inline-form input,
.inline-form select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-form input:focus,
.inline-form select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.inline-form .action-button {
    flex-grow: 0;
    padding: 10px 20px;
    background-color: #0ABAB5;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    height: 42px;
}

.inline-form .action-button:hover {
    background-color: #089a94;
}

.date-range-btn.active {
    background-color: #0ABAB5;
    color: #fff;
    border-color: #0ABAB5;
    font-weight: bold;
}

.form-subtitle {
    font-size: 1.1em;
    font-weight: bold;
    color: #555;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    width: 100%;
}
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}
.form-row .form-group {
    flex: 1 1 calc(50% - 10px);
    margin-bottom: 0;
}
.form-actions {
    text-align: right;
    margin-top: 25px;
    width: 100%;
}

.vertical-form-layout .form-group {
    margin-bottom: 18px;
}

.vertical-form-layout label {
    display: block;
    text-align: left;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: #495057;
}

.vertical-form-layout input,
.vertical-form-layout select,
.vertical-form-layout textarea {
    width: 100%;
    padding: 14px 12px;
    font-size: 1.05em;
    line-height: 1.5;
}

.vertical-form-layout .modal-footer {
    text-align: center;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-edit {
    background-color: #0ABAB5;
    border-color: #0ABAB5;
    color: white;
}
.btn-edit:hover {
    background-color: #089a94;
    border-color: #089a94;
    transform: translateY(-2px);
}

.btn-recipe {
    background-color: #C4A484;
    border-color: #C4A484;
    color: white;
}
.btn-recipe:hover {
    background-color: #b89874;
    border-color: #b89874;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
}


.btn-success-btn { background-color: #28a745; border-color: #28a745; color: white; }
.btn-success-btn:hover { background-color: #218838; }
.btn-xs { padding: 2px 8px; font-size: 12px; }

/* LINE Pay 發起付款按鈕樣式 */
.initiate-linepay-btn {
    background-color: #00C300;
    border-color: #00C300;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    line-height: 1.5;
}

.initiate-linepay-btn:hover {
    background-color: #00A000;
    border-color: #00A000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 195, 0, 0.3);
}

.initiate-linepay-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 195, 0, 0.25);
}

.initiate-linepay-btn:active {
    background-color: #008800;
    border-color: #008800;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 195, 0, 0.3);
}

.initiate-linepay-btn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 分頁控制項樣式 */
.pagination-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pagination-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #6c757d;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.per-page-selector label {
    font-size: 14px;
    color: #495057;
    margin: 0;
}

.per-page-selector select {
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

/* 頁碼按鈕容器 */
.page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 頁碼按鈕樣式 */
.page-number-btn {
    min-width: 36px;
    height: 36px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    background-color: white;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    user-select: none;
}

.page-number-btn:hover:not(:disabled) {
    background-color: #0ABAB5;
    color: white;
    border-color: #0ABAB5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(10, 186, 181, 0.2);
}

.page-number-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(10, 186, 181, 0.2);
}

/* 當前頁面按鈕樣式 */
.page-number-btn.current-page {
    background-color: #0ABAB5;
    color: white;
    border-color: #0ABAB5;
    cursor: default;
    font-weight: 600;
}

.page-number-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 省略號樣式 */
.page-ellipsis {
    padding: 6px 4px;
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    user-select: none;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .pagination-controls {
        padding: 10px;
        gap: 10px;
    }
    
    .pagination-navigation {
        gap: 5px;
    }
    
    .page-number-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .pagination-info {
        font-size: 13px;
        text-align: center;
    }
    
    .per-page-selector {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pagination-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .page-numbers {
        order: 2;
    }
    
    #prev-page-btn, #next-page-btn {
        order: 1;
        min-width: 80px;
    }
}
