:root { --brand: #14b8a6; --bg: #f1f5f9; --sidebar: #0f172a; --text: #334155; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); height: 100vh; display: flex; }

#login-screen { position: fixed; top:0; left:0; width:100%; height:100%; background: #fff; z-index: 999; display: flex; justify-content: center; align-items: center; }
.login-box { background: #fff; padding: 40px; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 300px; text-align: center; border: 1px solid #e2e8f0; }
.login-box h2 { color: var(--brand); margin-bottom: 20px; }
.login-box input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; }
.login-box button { width: 100%; padding: 12px; background: var(--brand); color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; }
.login-box button:hover { opacity: 0.9; }

#app-screen { display: none; width: 100%; height: 100%; display: flex; }
.sidebar { width: 240px; background: var(--sidebar); color: #fff; display: flex; flex-direction: column; padding: 20px; box-sizing: border-box; flex-shrink: 0;}
.sidebar h3 { margin-top: 0; margin-bottom: 20px; color: var(--brand); }

.manage-select { width: 100%; padding: 8px; margin-bottom: 20px; border-radius: 6px; border: 1px solid #475569; background: #1e293b; color: #fff; font-size: 15px; cursor: pointer; }

.nav-btn { background: none; border: none; color: #94a3b8; text-align: left; padding: 12px; font-size: 15px; cursor: pointer; border-radius: 8px; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; width: 100%; }
.nav-btn:hover, .nav-btn.active { background: rgba(255,255,255,0.1); color: #fff; }
.user-info { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 13px; color: #64748b; }

.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.page { display: none; }
.page.active { display: block; }

.form-group { margin-bottom: 15px; }
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }
input, select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.checkbox-group { display: flex; gap: 20px; align-items: center; background: #fff; padding: 10px; border-radius: 6px; border: 1px solid #cbd5e1; flex-wrap: wrap; }
.checkbox-group label { margin: 0; display: flex; align-items: center; cursor: pointer; font-weight: normal; margin-right: 10px;}
.checkbox-group input[type="checkbox"] { width: auto; margin-right: 8px; transform: scale(1.2); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; background: #fff; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; }
.cat-option { display: flex; align-items: center; font-size: 14px; cursor: pointer; }
.cat-option input { width: auto; margin-right: 6px; transform: scale(1.1); }

.dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.stat-card { background: #f0f9ff; padding: 15px; border-radius: 10px; border: 1px solid #bae6fd; }
.stat-title { font-size: 13px; color: #0369a1; font-weight: bold; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.stat-value { font-size: 24px; font-weight: 800; color: #0c4a6e; }
.log-list { max-height: 150px; overflow-y: auto; font-size: 13px; color: #475569; padding: 0; margin: 0; list-style: none; }
.log-list li { border-bottom: 1px solid #e0f2fe; padding: 4px 0; display: flex; justify-content: space-between; }

.top-bar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px;}
.search-box { width: 100%; margin-bottom: 10px; padding: 12px; font-size: 16px; border: 2px solid #cbd5e1; border-radius: 8px; box-sizing: border-box; }


.list-filters-row { margin-bottom:10px; display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }
.list-filters-left { display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:13px; color:#64748b; }
.list-filters-left select { padding:4px 8px; border-radius:6px; border:1px solid #cbd5e1; background:#f8fafc; }
.list-filters-right { display:flex; align-items:center; gap:8px; }
.list-count { font-size:13px; color:#475569; margin-left:4px; }
.status-msg { color:green; font-weight:bold; font-size:13px; }
.btn { padding: 8px 12px; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap:4px; font-size: 13px; transition: opacity 0.2s;}
.btn-primary { background: var(--brand); padding: 10px 16px; font-size: 14px; }
.btn-danger { background: #ef4444; }
.btn-warning { background: #f59e0b; }
.btn-edit { background: #3b82f6; }
.btn-copy-data { background: #6366f1; } 
.btn-copy-text { background: #059669; } 
.btn-download { background: #64748b; }
.btn-refresh { background: #64748b; }
.btn-quick { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; } 
.btn-quick:hover { background: #bae6fd; }
.btn-logout { background: #475569; }
.btn:hover { opacity: 0.9; }

.event-item { background: #fff; padding: 15px; border-radius: 8px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e2e8f0; flex-wrap: wrap; gap: 10px;}
.event-item.hidden { display: none; }
.event-info { flex: 1; min-width: 250px; }
.event-title { font-weight: bold; font-size: 1.1rem; color: #0f172a; display: block; margin-bottom: 4px; }
.event-meta { font-size: 0.9rem; color: #64748b; }
.event-pill { background: #ecfdf5; color: #065f46; padding: 2px 8px; border-radius: 99px; font-size: 0.8rem; margin-right: 6px; }
.status-expired { background: #fee2e2; color: #991b1b; padding: 2px 6px; border-radius: 4px; margin-left: 5px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-msg { text-align: center; padding: 40px; color: #94a3b8; font-size: 1.1em; }

.thumbnail-preview { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; margin-right: 10px; border: 1px solid #e2e8f0; vertical-align: middle; }

.user-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e2e8f0; }
.user-table th, .user-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #e2e8f0; }
.user-table th { background: #f8fafc; color: #475569; font-weight: 600; }
.role-badge { font-size: 12px; padding: 3px 8px; border-radius: 99px; }
.role-admin { background: #fee2e2; color: #b91c1c; }
.role-editor { background: #dbeafe; color: #1e40af; }
.add-user-box { background: #fff; padding: 20px; border-radius: 10px; border: 1px solid #e2e8f0; margin-bottom: 20px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* 營業時間產生器樣式 */
.schedule-editor { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-bottom: 10px; display: none; }
.schedule-row { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.schedule-label { width: 36px; font-weight: 600; color: #475569; font-size: 13px; }
.schedule-input { width: 130px !important; padding: 6px !important; font-size: 14px; }
.schedule-sep { color: #94a3b8; }
.schedule-split-group { display: none; align-items: center; gap:4px; }
.schedule-check { margin-left: 8px; font-size: 13px; display: flex; align-items: center; gap: 2px; cursor: pointer; color: #64748b; white-space: nowrap; }
.schedule-tools { display: flex; gap: 8px; margin-bottom: 12px; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; flex-wrap: wrap;}

#toast-container { 
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); 
    z-index: 3000; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast { 
    background: rgba(15, 23, 42, 0.9); color: #fff; padding: 10px 16px; border-radius: 8px; 
    font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: fadeInOut 3s forwards; 
    display: flex; align-items: center; gap: 8px; max-width: 80%; margin: 0 auto; backdrop-filter: blur(4px); 
}
@keyframes fadeInOut { 
    0% { opacity: 0; transform: translateY(20px); } 10% { opacity: 1; transform: translateY(0); } 
    90% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-10px); } 
}

.group-event, .group-food, .group-spots { display: none; }
body.mode-events .group-event { display: block; }
body.mode-events .group-event-flex { display: flex; }
body.mode-food .group-food { display: block; }
body.mode-spots .group-spots { display: block; }

@media (max-width: 768px) {
  #app-screen { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; padding: 10px; overflow-x: auto; align-items: center; gap: 10px;}
  .sidebar h3, .user-info { display: none; }
  .manage-select { width: auto; margin-bottom: 0; }
  .nav-btn { flex: 1; justify-content: center; margin-bottom:0; white-space: nowrap;}
  .dashboard { grid-template-columns: 1fr; }
  .add-user-box { flex-direction: column; align-items: stretch; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .actions { width: 100%; justify-content: flex-end; margin-top: 10px; }
  .schedule-input { width: 110px !important; }
}