* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f4f6f9; color: #333; display: flex; height: 100vh; overflow: hidden; }

/* 側邊欄 */
.sidebar { width: 260px; background: #18293A; color: white; display: flex; flex-direction: column; }
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 1.5rem; }
.sidebar-header p { font-size: 0.85rem; color: #94a3b8; margin-top: 4px; }
.sidebar-menu { flex: 1; list-style: none; padding: 1rem 0; }
.sidebar-menu li { padding: 14px 20px; cursor: pointer; color: #cbd5e1; font-size: 1.05rem; transition: 0.2s;}
.sidebar-menu li:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar-menu li.active { background: #2563eb; color: white; border-left: 4px solid #60a5fa; }
.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.back-link { color: #94a3b8; text-decoration: none; font-weight: bold; transition: 0.2s;}
.back-link:hover { color: white; }

/* 主內容區 */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 70px; background: white; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.02); z-index: 10;}
.topbar-right { display: flex; align-items: center; gap: 15px; }
#adminNameDisplay { font-weight: bold; color: #18293A; }
.btn-logout { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 6px 16px; border-radius: 6px; cursor: pointer; font-weight: bold; color: #ef4444; transition: 0.2s;}
.btn-logout:hover { background: #fee2e2; }

/* 頁面切換與卡片 */
.content-wrapper { flex: 1; padding: 30px; overflow-y: auto; }
.admin-section { display: none; animation: fadeIn 0.3s ease; }
.admin-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 30px; }
.stat-card { background: white; padding: 24px; border-radius: 12px; border-left: 4px solid #18293A; box-shadow: 0 4px 12px rgba(0,0,0,0.05);}
.stat-card h3 { font-size: 1rem; color: #64748b; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: bold; color: #18293A;}

.card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); overflow-x: auto;}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.admin-table th { background: #f8fafc; color: #334155; font-weight: bold; }
.admin-table td:last-child { white-space: nowrap; text-align: center; }
.btn-action { background: #fee2e2; border: none; padding: 6px 12px; border-radius: 4px; color: #ef4444; cursor: pointer; font-weight: bold; transition: 0.2s;}
.btn-action:hover { background: #fca5a5; color: white;}