* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f5f5; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: #263238; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-brand { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand h2 { margin: 0; font-size: 16px; }
.sidebar-brand p { margin: 4px 0 0; font-size: 11px; opacity: 0.6; }
.sidebar-nav { flex: 1; padding: 8px 0; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; border-left: 3px solid transparent; transition: all 0.2s; }
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link.active { background: rgba(25,118,210,0.3); border-left-color: #1976D2; color: #fff; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.1); padding: 8px 0; }
.admin-main { flex: 1; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; padding: 0 24px; height: 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e0e0e0; font-size: 13px; }
.admin-topbar a { color: #1976D2; text-decoration: none; }
.admin-content { flex: 1; padding: 24px; }

.admin-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-page-header h3 { margin: 0; font-size: 18px; }

.kpi-cards { display: flex; gap: 16px; margin-bottom: 24px; }
.kpi-card { flex: 1; padding: 20px; border-radius: 8px; color: #fff; }
.kpi-blue { background: linear-gradient(135deg,#1976D2,#42A5F5); }
.kpi-green { background: linear-gradient(135deg,#00BFA5,#26A69A); }
.kpi-orange { background: linear-gradient(135deg,#FF7043,#FF8A65); }
.kpi-purple { background: linear-gradient(135deg,#7E57C2,#9575CD); }
.kpi-value { font-size: 28px; font-weight: bold; }
.kpi-label { font-size: 12px; opacity: 0.8; margin-top: 4px; }

.chart-row { display: flex; gap: 16px; margin-bottom: 24px; }
.chart-card { flex: 1; background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.chart-full { flex: none; width: 100%; }
.chart-title { font-size: 14px; font-weight: bold; margin-bottom: 12px; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.admin-table th { background: #fafafa; padding: 10px 12px; text-align: left; font-size: 13px; color: #666; border-bottom: 1px solid #eee; }
.admin-table td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.admin-table tr:hover td { background: #fafafa; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #fff; }
.tag-logic { background: #1976D2; }
.tag-personality { background: #00BFA5; }
.tag-professional { background: #FF9800; }

.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.filter-bar { margin-bottom: 16px; display: flex; gap: 8px; }
.filter-tag { padding: 6px 14px; border-radius: 16px; text-decoration: none; font-size: 13px; color: #666; background: #fff; border: 1px solid #e0e0e0; }
.filter-tag.active { background: #1976D2; color: #fff; border-color: #1976D2; }

.pagination { margin-top: 16px; display: flex; align-items: center; gap: 4px; }
.page-link { padding: 6px 12px; border: 1px solid #e0e0e0; border-radius: 4px; text-decoration: none; font-size: 13px; color: #666; }
.page-link.active { background: #1976D2; color: #fff; border-color: #1976D2; }

.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; text-decoration: none; font-size: 14px; border: none; cursor: pointer; }
.btn-primary { background: #1976D2; color: #fff; }
.btn-outline { background: #fff; color: #1976D2; border: 1px solid #1976D2; }
.btn-danger { background: #d32f2f; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-sm.btn-outline { background: #fff; color: #1976D2; border: 1px solid #1976D2; text-decoration: none; display: inline-block; }
.btn-sm.btn-danger { background: #d32f2f; color: #fff; border: none; cursor: pointer; font-size: 12px; }

.form-card { background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.form-row { display: flex; gap: 12px; }
.form-group { margin-bottom: 14px; flex: 1; }
.form-group label { display: block; margin-bottom: 4px; font-size: 13px; color: #666; }
.form-control { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.hint { font-size: 12px; color: #999; margin: 0 0 8px; }

.option-panel { margin-bottom: 12px; }
.option-row { display: flex; align-items: center; gap: 8px; padding: 8px; background: #fafafa; border-radius: 4px; margin-bottom: 6px; }
.option-row .form-control { flex: 1; }
.option-remove { color: #999; cursor: pointer; font-size: 18px; }
.option-remove:hover { color: #d32f2f; }

.detail-info { background: #fff; border-radius: 8px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: flex; flex-wrap: wrap; gap: 16px; }
.info-item { flex: 1 1 45%; display: flex; }
.info-label { color: #999; width: 80px; flex-shrink: 0; font-size: 13px; }

.admin-table th a { color: #333; text-decoration: none; }
.admin-table th a:hover { color: #1976D2; }
.admin-table th a.sort-active { color: #1976D2; font-weight: 700; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; padding: 28px 32px; max-width: 440px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.2); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-size: 16px; font-weight: bold; margin: 0 0 8px; }
.modal-body { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-btn { padding: 8px 20px; border-radius: 6px; font-size: 14px; border: none; cursor: pointer; }
.modal-btn-primary { background: #1976D2; color: #fff; }
.modal-btn-primary:hover { background: #1565C0; }
.modal-btn-cancel { background: #f5f5f5; color: #666; }
.modal-btn-cancel:hover { background: #e0e0e0; }
.modal-btn-danger { background: #d32f2f; color: #fff; }
.modal-btn-danger:hover { background: #b71c1c; }
