* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fff5f7 0%, #f0f2f5 100%); }
.login-box { background: #fff; padding: 40px; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); width: 380px; }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 8px; }
.login-box .subtitle { text-align: center; color: #999; margin-bottom: 32px; font-size: 13px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; outline: none; transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: #ff7a92; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1a1a2e; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-logo { padding: 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-group-title { padding: 12px 20px 6px; font-size: 11px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }
.nav-item { padding: 10px 20px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.7); transition: all 0.2s; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,122,146,0.2); color: #ff7a92; border-right: 3px solid #ff7a92; }
.nav-item.sub { padding-left: 36px; font-size: 13px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: rgba(255,255,255,0.5); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #666; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* Cards & Stats */
.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.stat-item { text-align: center; padding: 20px 16px; background: #f8f9fa; border-radius: 10px; }
.stat-value { font-size: 28px; font-weight: 700; color: #ff7a92; }
.stat-label { font-size: 12px; color: #999; margin-top: 4px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
th { background: #fafafa; color: #666; font-weight: 500; white-space: nowrap; }
tr:hover td { background: #fafafa; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; }

/* Buttons */
.btn { padding: 8px 16px; background: #ff7a92; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background 0.2s; }
.btn:hover { background: #ff5a70; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-outline { background: #fff; color: #ff7a92; border: 1px solid #ff7a92; }
.btn-outline:hover { background: #fff5f7; }
.btn-danger { background: #ff4d4f; }
.btn-danger:hover { background: #ff7875; }
.btn-text { background: none; color: #ff7a92; padding: 4px 8px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-gold { background: #fff7e6; color: #d48806; }
.tag-silver { background: #f0f0f0; color: #666; }
.tag-normal { background: #f6ffed; color: #52c41a; }
.tag-active { background: #f6ffed; color: #52c41a; }
.tag-disabled { background: #fff1f0; color: #ff4d4f; }
.tag-paid { background: #e6f4ff; color: #1677ff; }
.tag-free { background: #f6ffed; color: #52c41a; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 13px; }
.toolbar input { width: 200px; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination span { color: #999; font-size: 13px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* Misc */
.loading { text-align: center; padding: 60px; color: #999; }
.error { color: #ff4d4f; padding: 20px; text-align: center; }
.empty { text-align: center; padding: 40px; color: #999; }
.checkbox-list { max-height: 200px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 8px; padding: 8px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; font-size: 13px; }
.checkbox-list label:hover { background: #f8f9fa; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .nav-item span.label, .nav-group-title, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
