/* Nino Salon System - Final Master Edition (v48 - v43 Aesthetics + RBAC) */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container { display: flex; min-height: 100vh; }

/* 側邊欄 - 毛玻璃質感 */
.sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0; top: 0;
    z-index: 1000;
}

.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    color: rgba(255, 255, 255, 0.7); text-decoration: none; border-radius: 8px; margin-bottom: 8px;
    transition: all 0.3s; cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.nav-item.active { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); color: white; }

/* 主要內容區 */
.main-content { flex: 1; margin-left: 260px; display: flex; flex-direction: column; }

.top-bar {
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: sticky; top: 0; z-index: 100;
}

.content-area { padding: 24px; flex: 1; }
.page-section { display: none; }
.page-section.active { display: block; }
.page-title { font-size: 1.8rem; font-weight: bold; margin-bottom: 24px; color: white; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }

/* 主頁九宮格 */
.home-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; margin-bottom: 30px; }
.menu-item-btn {
    display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px;
    background: white; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer; text-decoration: none; color: #333; transition: all 0.3s;
}
.menu-item-btn i { font-size: 1.8rem; color: #667eea; }

/* 看板與卡片 */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-card { background: rgba(255, 255, 255, 0.95); padding: 24px; border-radius: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.card { background: white; border-radius: 12px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* POS 專屬二欄佈局 (找回 v43/v45 最棒版本) */
.pos-container { display: grid; grid-template-columns: 1fr 400px; gap: 20px; }
.pos-left { display: flex; flex-direction: column; gap: 20px; }
.pos-right { display: flex; flex-direction: column; }

.quick-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 10px; }
.quick-btn {
    padding: 15px 10px; border: 1px solid #eef2ff; border-radius: 12px;
    background: white; font-size: 1rem; font-weight: bold; cursor: pointer; text-align: center;
    transition: all 0.2s;
}
.quick-btn:hover { border-color: #667eea; transform: translateY(-2px); }
.quick-btn.product { border-left: 5px solid #10b981; }
.quick-btn span { display: block; font-size: 0.8rem; color: #667eea; margin-top: 5px; }

/* 購物車精美化 (v45 優化版) */
.cart-items { margin: 15px 0; max-height: 450px; overflow-y: auto; padding-right: 5px; }
.cart-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px; background: white; border-radius: 12px; margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05); border: 1px solid #f0f0f0;
}
.cart-item-name { font-weight: bold; color: #333; font-size: 1rem; flex: 1; }
.cart-item-right { display: flex; align-items: center; gap: 15px; }
.item-qty-box { background: #f3f4f6; border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; }
.item-qty-box input { width: 35px; border: none; background: transparent; text-align: center; font-weight: bold; font-size: 1rem; outline: none; }
.cart-item-price { font-weight: bold; color: #667eea; min-width: 80px; text-align: right; font-size: 1rem; }

.btn-remove {
    background: #fee2e2; color: #ef4444; border: none; width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-remove:hover { background: #ef4444; color: white; transform: rotate(90deg); }

/* 狀態指示 */
.status-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f8f9fa; border-radius: 10px; margin-bottom: 8px; }
.status-indicator { width: 12px; height: 12px; border-radius: 50%; }
.status-indicator.idle { background: #10b981; }
.status-indicator.busy { background: #f59e0b; }
.status-indicator.away { background: #ef4444; }

/* 按鈕 */
.btn { padding: 12px 24px; border: none; border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.3s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: #667eea; color: white; box-shadow: 0 4px 10px rgba(102,126,234,0.3); }
.btn-secondary { background: #e5e7eb; color: #4b5563; }
.btn-danger { background: #ef4444; color: white; }
.btn-small { padding: 8px 14px; font-size: 0.85rem; }

/* 響應式 - 手機版強制優化 */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: 60px; flex-direction: row; bottom: 0; top: auto; padding: 0; border-top: 1px solid #e5e7eb; background: white; }
    .sidebar-nav { display: flex; justify-content: space-around; width: 100%; }
    .nav-item { flex-direction: column; gap: 2px; font-size: 0.65rem; padding: 8px 0; flex: 1; border-radius: 0; color: #666; }
    .nav-item.active { background: transparent; color: #667eea; }
    .main-content { margin-left: 0; margin-bottom: 60px; }
    .pos-container { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .home-menu-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .menu-item-btn { padding: 12px 5px; border-radius: 12px; }
    .menu-item-btn i { font-size: 1.4rem; }
    .menu-item-btn span { font-size: 0.75rem; }
}

/* 模態框 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; border-radius: 16px; padding: 30px; width: 95%; max-width: 500px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); overflow-y: auto; max-height: 90vh; }

/* 表格 */
.data-table-container { background: white; border-radius: 12px; overflow-x: auto; margin-top: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
.data-table th { background: #f8faff; color: #667eea; font-weight: bold; }
