/* 全域設定 */
body { background-color: #f4f6f9; font-family: "Microsoft JhengHei", system-ui; }
.text-purple { color: #6f42c1; }
.btn-purple { background-color: #6f42c1; color: white; }
.btn-purple:hover { background-color: #59359a; color: white; }

/* 側邊欄 */
.sidebar {
    height: 100vh; position: fixed; top: 0; left: 0; width: 250px;
    background: linear-gradient(180deg, #2c3e50 0%, #4ca1af 100%);
    color: white; padding-top: 30px; z-index: 1000;
}
.sidebar a {
    padding: 15px 25px; text-decoration: none; font-size: 1.1em;
    color: rgba(255,255,255,0.7); display: block; cursor: pointer; transition: 0.2s;
}
.sidebar a:hover, .sidebar a.active { color: white; background-color: rgba(255,255,255,0.1); border-left: 5px solid #fff; }
.sidebar i { margin-right: 12px; }

/* 內容區 */
.main-content { margin-left: 250px; padding: 30px; }
.page-section { display: none; animation: fadeIn 0.3s; }
.page-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 登入畫面 */
#login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #eef2f5; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}

/* 🧾 專業版收據樣式 (仿A4紙張) */
.receipt-paper {
    background: #fff;
    width: 100%;
    max-width: 800px; /* 限制寬度 */
    padding: 40px;
    border-radius: 4px;
    color: #333;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* 🖨️ 列印專用設定 (只印收據) */
@media print {
    body * { visibility: hidden; } /* 隱藏所有東西 */
    #receiptModal { position: absolute; left: 0; top: 0; margin: 0; padding: 0; overflow: visible; }
    #receipt-box, #receipt-box * { visibility: visible; } /* 只顯示收據 */
    #receipt-box {
        position: absolute; left: 0; top: 0;
        width: 100%; max-width: 100%; margin: 0; padding: 20px;
        box-shadow: none; border: none;
    }
    .modal-dialog { max-width: 100%; margin: 0; }
    .modal-content { border: none; }
    .modal-header, .modal-footer { display: none; } /* 隱藏按鈕 */
}

/* 手機版適配 */
@media (max-width: 768px) {
    .sidebar { width: 70px; padding-top: 20px; }
    .sidebar span, .sidebar h4 { display: none; }
    .sidebar i { font-size: 1.5em; margin: 0; }
    .sidebar a { text-align: center; padding: 15px 0; }
    .main-content { margin-left: 70px; padding: 15px; }
}