/* Admin-only workspace. Homepage module editor intentionally keeps its own styles. */
.admin-app { background: #f4f6fa; grid-template-columns: 224px minmax(0,1fr); }
.admin-app[hidden], .admin-content > section[hidden] { display: none !important; }
.demo-pill[hidden] { display: none !important; }
.sidebar { width: 224px; padding: 30px 18px 20px; background: #171d2b; overflow-y: auto; }
.sidebar .admin-brand { margin-left: 12px; font-size: 25px; }
.workspace-label { color: #8e98ae; font-size: 12px; margin: 20px 12px 0; letter-spacing: 2px; }
.sidebar nav { margin-top: 30px; gap: 6px; }
.sidebar nav a { min-height: 46px; padding: 12px; border-radius: 10px; color: #bcc5d6; font-size: 13px; }
.sidebar nav a:hover { background: #242c3e; color: white; }
.sidebar nav a.active { background: #ffda1a; color: #171d2b; box-shadow: 0 5px 18px #0002; }
.nav-group-label { margin: 20px 12px 6px; color: #7f8aa1; font-size: 10px; letter-spacing: 1.5px; }
.nav-group-label:first-child { margin-top: 0; }
.sidebar-bottom { border-top: 1px solid #ffffff18; padding-top: 18px; }
.admin-header { background: #fff; border-bottom: 1px solid #e5e9f1; padding: 0 32px; }
.admin-header > div:first-child { display: flex; gap: 14px; align-items: center; }
.admin-profile > span { background: #edf2ff; color: #2857bc; }
.admin-content { padding: 30px 32px 54px; max-width: 1600px; margin: 0 auto; }
.admin-content > section:not(#sections) { padding-top: 0; margin-top: 0; min-width: 0; }
.admin-content > section:not(#sections) :is(.page-heading,.section-heading) { margin-bottom: 24px; align-items: center; gap: 18px; }
.admin-content > section:not(#sections) :is(.page-heading,.section-heading) p { color: #6880ab; font-size: 10px; letter-spacing: 2px; font-weight: 700; }
.admin-content > section:not(#sections) :is(h1,h2,h3) { color: #1a2436; }
.admin-content > section:not(#sections) :is(.page-heading h1,.section-heading h2) { font-size: 27px; letter-spacing: -.6px; margin: 6px 0 8px; }
.admin-content > section:not(#sections) :is(.page-heading,.section-heading) span { color: #737f92; font-size: 13px; line-height: 1.7; }
.admin-content > section:not(#sections) :is(.panel,.table-panel) { border: 1px solid #e4e9f1; border-radius: 16px; box-shadow: 0 4px 18px #24365c04; overflow: hidden; }
.admin-content > section:not(#sections) .panel-head { gap: 16px; align-items: center; }
.admin-content > section:not(#sections) .panel-head h2 { font-size: 18px; margin: 4px 0; }
.admin-content > section:not(#sections) .panel-head p { font-size: 10px; letter-spacing: 1.4px; color: #8b96a8; }
.admin-content > section:not(#sections) .panel-head span { line-height: 1.7; }
.admin-content > section:not(#sections) :is(input:not([type=checkbox]):not([type=file]):not([type=hidden]), select, textarea) { border: 1px solid #dce2ed; border-radius: 9px; color: #26344c; background: #fff; font: inherit; font-size: 13px; min-height: 42px; padding: 11px 12px; min-width: 0; }
.admin-content > section:not(#sections) textarea { line-height: 1.8; }
.admin-app :is(a,button,input,select,textarea):focus-visible { outline: 3px solid #85a8ff; outline-offset: 3px; }
.admin-content > section:not(#sections) :is(button,.export-button) { border-radius: 9px; }
.admin-app button:disabled { opacity: .5; cursor: not-allowed; }
.workspace-actions { display: flex; align-items: center; gap: 12px; }
.workspace-actions button, #users [data-reset-users] { padding: 11px 16px; background: #fff; border: 1px solid #dce2ed; color: #374967; white-space: nowrap; cursor: pointer; }
.workspace-meta { color: #8290a4; font-size: 12px; line-height: 1.6; margin: 0 0 16px; }
.workspace-meta.is-error { color: #ba3434; }
.stat-grid { gap: 12px; }
.stat-card { padding: 20px 16px; border: 1px solid #e4e9f1; border-radius: 13px; box-shadow: none; }
.stat-card > span { color: #65738a; font-size: 12px; }
.stat-card strong { font-size: 29px; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.stat-card small { color: #94a0b2; font-size: 10px; }
.stat-card:nth-child(2) { background: #245dff; border-color: #245dff; color: white; }
.stat-card:nth-child(2) > span, .stat-card:nth-child(2) small { color: #e0e9ff; }
.workspace-extra-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.workspace-extra-stats article { padding: 18px; border-radius: 12px; background: #eaf0fb; display: grid; gap: 7px; }
.workspace-extra-stats span { color: #4f6487; font-size: 12px; }
.workspace-extra-stats strong { color: #234d97; font-size: 23px; }
.workspace-extra-stats small { color: #7789a4; font-size: 10px; }
.workspace-tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.workspace-task { display: flex; gap: 16px; align-items: center; background: #fff; border: 1px solid #e4e9f1; border-radius: 13px; padding: 18px 20px; color: #243550; text-decoration: none; }
.workspace-task:hover { border-color: #a2baff; }
.workspace-task > strong { width: 42px; height: 42px; display: grid; place-items: center; background: #fff3cd; color: #8a6013; border-radius: 11px; font-size: 22px; flex: 0 0 auto; }
.workspace-task:nth-child(2) > strong { background: #eaf0ff; color: #2857be; }
.workspace-task div { display: grid; gap: 6px; flex: 1; }
.workspace-task b { font-size: 13px; }
.workspace-task small { font-size: 11px; color: #8b97a8; }
.insight-grid { gap: 18px; margin-top: 22px; }
#overview :is(.chart-panel,.source-panel) { padding: 24px; }
#overview .chart-bar { min-height: 0; border-radius: 5px 5px 0 0; background: #527df5; }
#overview .chart-column:last-child .chart-bar { background: #ffda1a; }
#overview .source-row { grid-template-columns: minmax(88px,1fr) minmax(25px,1fr) auto; gap: 10px; padding: 13px 0; border-bottom: 1px solid #f0f3f8; }
#overview .source-row > span { min-width: 88px; }
#overview .source-track { border-radius: 4px; overflow: hidden; }
#overview .trend { background: #eff4ff; color: #5576b3; }
.workspace-empty { padding: 24px; text-align: center; color: #8b97a8; font-size: 13px; }
#users .filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; padding: 18px; border-radius: 14px; border: 1px solid #e4e9f1; background: #fff; margin-bottom: 12px; }
#users .search-field { grid-column: span 2; min-width: 0; width: auto; border: 1px solid #dce2ed; border-radius: 9px; padding-left: 13px; }
#users .search-field input { border: 0; width: 100%; background: transparent; }
#users .filters select { width: 100%; }
#users .user-cell { align-items: flex-start; gap: 10px; }
#users .table-avatar { width: 33px; height: 33px; flex: 0 0 33px; background: #edf2ff; color: #4462a7; border-radius: 10px; }
#users .user-cell strong { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.6; }
#users .user-cell small { display: block; margin-top: 5px; }
#users .participation { flex-wrap: wrap; gap: 5px; }
.workspace-user-table { width: 100%; table-layout: fixed; }
.workspace-user-table th:nth-child(1) { width: 23%; }
.workspace-user-table th:nth-child(2) { width: 18%; }
.workspace-user-table th:nth-child(3) { width: 17%; }
.workspace-user-table th:nth-child(4) { width: 22%; }
.workspace-user-table th:nth-child(5) { width: 20%; }
#users :is(th,td){ white-space: normal; overflow-wrap: anywhere; padding: 17px 16px; line-height: 1.65; vertical-align: top; border-bottom: 1px solid #edf0f6; }
#users th{ background: #f8fafd; color: #6b7c95; font-weight: 600; font-size: 11px; }
#users td { font-size: 12px; color: #32445f; }
#users td small { color: #8a97aa; font-size: 11px; }
.workspace-user-details { margin-top: 9px; font-size: 11px; color: #70809a; }
.workspace-user-details summary { color: #3865b7; cursor: pointer; }
.workspace-user-details p { margin: 6px 0 0; overflow-wrap: anywhere; }
.workspace-pill { display: inline-block; padding: 3px 7px; border-radius: 5px; background: #eef3ff; color: #3a63b1; font-size: 10px; margin: 4px 0; }
.workspace-pill.muted { color: #8090a5; background: #f1f3f7; }
.workspace-pill.vip { background: #fff3ce; color: #926e1a; }
#users .pagination { padding: 18px; gap: 12px; flex-wrap: wrap; color: #7d8ca2; }
#users .pagination > div { display: flex; gap: 8px; align-items: center; }
#users .pagination select { min-height: 34px; padding: 7px; }
.workspace-entry-table th:first-child { width: 26%; }
.workspace-entry-table th:nth-child(2) { width: 16%; }
.workspace-entry-table th:nth-child(3) { width: 14%; }
.workspace-entry-table th:nth-child(4) { width: 12%; }
.workspace-entry-table th:nth-child(5) { width: 9%; }
.workspace-entry-table th:last-child { width: 23%; }
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .admin-content { padding: 26px 22px; }
}
@media (max-width: 900px) {
  .admin-app { grid-template-columns: 188px minmax(0,1fr); }
  .sidebar { width: 188px; padding: 26px 12px; }
  .sidebar .admin-brand { font-size: 23px; }
  .sidebar nav a { font-size: 12px; padding: 11px 9px; }
  .workspace-extra-stats { grid-template-columns: 1fr 1fr; }
  .workspace-tasks, .insight-grid { grid-template-columns: minmax(0,1fr); }
  #users .filters { grid-template-columns: 1fr 1fr; }
  #users .table-scroll{ overflow: visible; }
  #users .workspace-user-table{ display: block; }
  #users thead{ display: none; }
  #users tbody{ display: block; }
  #users tbody tr{ display: grid; grid-template-columns: 1fr 1fr; padding: 12px; border-bottom: 1px solid #e2e8f2; gap: 5px; }
  #users tbody td{ display: block; border: none; padding: 10px; }
  #users tbody td::before{ content: attr(data-label); display: block; color: #95a0b1; font-size: 10px; margin-bottom: 7px; }
  #users td:first-child{ grid-column: 1 / -1; }
  #users td[colspan]{ grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .admin-app { display: block; }
  .sidebar { width: 100%; position: static; padding: 18px; }
  .sidebar .admin-brand { margin-left: 0; }
  .workspace-label, .nav-group-label { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 18px; overflow: visible; gap: 7px; }
  .sidebar nav a { min-width: 0; min-height: 42px; font-size: 11px; justify-content: center; white-space: normal; }
  .sidebar nav a > span { display: none; }
  .sidebar-bottom { display: flex; gap: 20px; position: static; margin-top: 15px; padding-top: 12px; }
  .sidebar-bottom :is(a,button) { font-size: 11px; }
  .admin-header { display: flex; height: 58px; padding: 0 18px; }
  .admin-profile { display: none; }
  .admin-content { padding: 24px 16px; }
  .admin-content > section:not(#sections) :is(.page-heading,.section-heading) { align-items: flex-start; flex-wrap: wrap; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card strong { font-size: 25px; }
  #users .pagination > div { flex-wrap: wrap; }
}

/* User avatars use the same account photo as the profile editor. */
#users .table-avatar { position: relative; overflow: hidden; }
#users .table-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #edf2ff; }

/* Private user-submitted profile details, scoped to the admin workspace. */
.workspace-wechat { margin: 7px 0; overflow-wrap: anywhere; font-size: 13px; }
.user-detail-dialog { box-sizing: border-box; width: min(820px, calc(100vw - 32px)); max-height: 88vh; padding: 26px; border: 1px solid #e4e7ed; border-radius: 20px; background: #fff; color: #1d2638; box-shadow: 0 24px 80px #14233d40; }
.user-detail-dialog::backdrop { background: #14233d80; }
.user-detail-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.user-detail-dialog h2 { margin: 4px 0 16px; font-size: 23px; overflow-wrap: anywhere; }
.user-detail-dialog header p { margin: 0; color: #687588; font-size: 12px; }
.user-detail-dialog button { flex-shrink: 0; padding: 9px 14px; border: 1px solid #dce1e8; border-radius: 9px; background: #f6f8fb; color: #25334c; cursor: pointer; }
.user-detail-dialog button:focus-visible, .user-detail-group summary:focus-visible { outline: 3px solid #548aff; outline-offset: 3px; }
.user-detail-notice { color: #687588; font-size: 13px; line-height: 1.6; margin: 0 0 20px; }
.user-detail-group { border: 1px solid #e6eaf0; border-radius: 12px; margin: 12px 0; }
.user-detail-group summary { padding: 16px; cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.user-detail-group dl { margin: 0; padding: 0 16px 12px; }
.user-detail-group dl > div { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 18px; padding: 12px 0; border-top: 1px solid #eff1f5; }
.user-detail-group dt { color: #687588; font-size: 13px; }
.user-detail-group dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 14px; }
@media (max-width: 600px) { .user-detail-dialog { padding: 18px; } .user-detail-group dl > div { grid-template-columns: 1fr; gap: 5px; } .user-detail-dialog h2 { font-size: 19px; } }
