:root {
  --bg: #f3eeec;
  --bg-warm: #faf6f4;
  --surface: #fffcfb;
  --surface-soft: #faf6f4;
  --ink: #333333;
  --muted: #888888;
  --line: #ebe3e0;
  --line-strong: #ddd4d0;
  --accent: #e62e2d;
  --accent-strong: #c62828;
  --accent-soft: #ffebee;
  --teal: #43a047;
  --teal-soft: #e8f5e9;
  --gold: #f57c00;
  --shadow-sm: 0 2px 10px rgba(80, 40, 35, 0.05);
  --shadow-md: 0 8px 24px rgba(80, 40, 35, 0.07);
  --shadow-lg: 0 14px 36px rgba(80, 40, 35, 0.09);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 "Microsoft YaHei", "PingFang SC", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  padding: 20px 14px 18px;
  background: linear-gradient(180deg, #3a2f2f 0%, #2f2626 100%);
  border-right: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-copy {
  flex: 1;
  min-width: 0;
  padding-right: 68px;
}

.sidebar-tools {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-reopen-btn {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9000;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #3a2f2f 0%, #2f2626 100%);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  font-family: inherit;
}

.sidebar-reopen-btn:hover {
  background: #4a3d3d;
}

html.sidebar-collapsed-boot .sidebar,
.layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
  padding-left: 10px;
  padding-right: 10px;
}

html.sidebar-collapsed-boot .brand-copy,
html.sidebar-collapsed-boot .nav-label,
html.sidebar-collapsed-boot .sidebar-foot .nav-label,
.layout.sidebar-collapsed .brand-copy,
.layout.sidebar-collapsed .nav-label,
.layout.sidebar-collapsed .sidebar-foot .nav-label {
  display: none;
}

html.sidebar-collapsed-boot .brand,
.layout.sidebar-collapsed .brand {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
}

html.sidebar-collapsed-boot .sidebar-tools,
.layout.sidebar-collapsed .sidebar-tools {
  position: static;
  margin-left: 0;
  width: 100%;
  justify-content: center;
}

html.sidebar-collapsed-boot .nav a,
html.sidebar-collapsed-boot .sidebar-qr-btn,
html.sidebar-collapsed-boot .sidebar-foot a,
.layout.sidebar-collapsed .nav a,
.layout.sidebar-collapsed .sidebar-qr-btn,
.layout.sidebar-collapsed .sidebar-foot a {
  justify-content: center;
  padding: 0 8px;
}

html.sidebar-collapsed-boot .nav a.active,
.layout.sidebar-collapsed .nav a.active,
html.sidebar-collapsed-boot .sidebar-foot a.active,
.layout.sidebar-collapsed .sidebar-foot a.active {
  box-shadow: inset 0 3px 0 var(--accent);
}

html.sidebar-hidden-boot .sidebar,
.layout.sidebar-hidden .sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  white-space: nowrap;
}

.brand span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a,
.sidebar-foot a,
.sidebar-qr-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-qr-btn {
  width: 100%;
  margin: 0 0 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.nav a:hover,
.sidebar-foot a:hover,
.sidebar-qr-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav a.active,
.sidebar-foot a.active {
  background: rgba(230, 46, 45, 0.18);
  color: #fff;
  font-weight: 700;
  border: 0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav a.active .nav-icon,
.sidebar-foot a.active .nav-icon {
  opacity: 1;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 17px;
  opacity: 0.88;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.topbar-copy h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.user-meta {
  display: grid;
  gap: 1px;
}

.user-meta strong {
  font-size: 13px;
}

.user-meta span {
  color: var(--muted);
  font-size: 12px;
}

.card,
.table-card,
.panel-card,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.admin-page {
  display: grid;
  gap: 20px;
}

.admin-page > .table-card,
.admin-page > .card,
.admin-page > .panel-card,
.admin-page > section {
  margin-top: 0 !important;
}

.section-head {
  position: relative;
  padding-left: 14px;
}

.section-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: var(--accent);
}

.toolbar > div:first-child,
.panel-head > div:first-child {
  position: relative;
  padding-left: 14px;
}

.toolbar > div:first-child::before,
.panel-head > div:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: var(--accent);
}

.toolbar h3,
.panel-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar-actions .ghost-btn.active {
  background: var(--accent-soft);
  border-color: rgba(230, 46, 45, 0.22);
  color: var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.metric {
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 46, 45, 0.1) 0%, rgba(230, 46, 45, 0) 70%);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric a {
  display: block;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  font-size: 18px;
}

.metric h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card,
.panel-card {
  padding: 22px;
}

.panel-card-muted {
  margin-top: 16px;
  background: var(--surface-soft);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head p,
.toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel-badge {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.panel-badge-warn {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.two-column {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  margin-top: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.table-card {
  padding: 22px;
  overflow: auto;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--bg-warm);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

th:first-child {
  border-top-left-radius: 12px;
}

th:last-child {
  border-top-right-radius: 12px;
}

tbody tr:hover td {
  background: rgba(255, 235, 238, 0.35);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.btn,
.primary-btn,
button[type="submit"],
button.btn,
button.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn,
.primary-btn,
button[type="submit"],
button.btn,
button.primary-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(230, 46, 45, 0.18);
}

.btn:hover,
.primary-btn:hover,
button[type="submit"]:hover,
button.btn:hover,
button.primary-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.ghost-btn,
button.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  background: var(--surface);
  color: var(--accent-strong);
  border: 1px solid rgba(230, 46, 45, 0.18);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ghost-btn:hover,
button.ghost-btn:hover {
  background: var(--accent-soft);
  border-color: rgba(230, 46, 45, 0.28);
}

.ghost-btn-danger {
  color: var(--accent-strong);
  border-color: rgba(230, 46, 45, 0.22);
}

.btn.small,
.ghost-btn.small,
button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

form.inline {
  display: inline;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(230, 46, 45, 0.45);
  box-shadow: 0 0 0 4px rgba(230, 46, 45, 0.08);
}

input[disabled] {
  background: var(--bg-warm);
  color: var(--muted);
}

input[type="file"] {
  display: none;
}

.image-upload {
  display: grid;
  gap: 12px;
}

.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 148px;
  padding: 22px 18px;
  border: 1.5px dashed rgba(230, 46, 45, 0.28);
  border-radius: var(--radius-lg);
  background: var(--bg-warm);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.upload-dropzone:hover {
  border-color: rgba(230, 46, 45, 0.5);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.upload-dropzone-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  font-size: 24px;
  line-height: 1;
}

.upload-dropzone-title {
  color: var(--ink);
  font-size: 15px;
}

.upload-dropzone-note,
.upload-file-name {
  color: var(--muted);
  font-size: 12px;
}

.upload-file-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-name.is-selected {
  color: var(--accent-strong);
  font-weight: 700;
}

.upload-preview-wrap[hidden] {
  display: none !important;
}

.upload-preview {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 168px;
  object-fit: cover;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f2e9;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.verify-form {
  grid-template-columns: 1fr auto;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
}

.setting-toggle-row .field-help {
  margin-top: 6px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c8c4bc;
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-checkin-readonly {
  margin-bottom: 4px;
}

.review-checkin-readonly > div + div {
  margin-top: 10px;
}

.review-checkin-readonly .application-checkin-previews {
  margin-top: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-item {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
}

.info-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.volunteer-avatar {
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  flex-shrink: 0;
}

.volunteer-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.volunteer-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.volunteer-profile-head strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.table-volunteers {
  table-layout: fixed;
}

.table-volunteers th,
.table-volunteers td {
  padding: 10px 12px;
  white-space: nowrap;
  vertical-align: middle;
}

.table-volunteers .col-avatar {
  width: 56px;
}

.table-volunteers .col-name {
  width: 108px;
}

.table-volunteers .col-phone {
  width: 118px;
}

.table-volunteers .col-address {
  width: 22%;
}

.table-volunteers .col-political {
  width: 14%;
}

.table-volunteers .col-skill {
  width: 12%;
}

.table-volunteers .col-num {
  width: 64px;
  text-align: center;
}

.table-volunteers .col-status {
  width: 88px;
}

.table-volunteers .col-action {
  width: 72px;
  text-align: center;
}

.volunteer-rank-board {
  margin-bottom: 20px;
}

.volunteer-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.volunteer-rank-panel {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, var(--bg-warm) 100%);
}

.volunteer-rank-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.volunteer-rank-panel-head h4 {
  margin: 0;
  font-size: 17px;
  color: var(--ink);
}

.volunteer-rank-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.volunteer-rank-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.volunteer-rank-filter select {
  min-width: 92px;
}

.volunteer-rank-tier + .volunteer-rank-tier {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.volunteer-rank-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.volunteer-rank-tier-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.volunteer-rank-tier-order {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.volunteer-rank-tier-title h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.volunteer-rank-tier-quota {
  font-size: 12px;
  color: var(--muted);
}

.volunteer-rank-stars {
  color: #d4a017;
  letter-spacing: 1px;
  font-size: 13px;
}

.volunteer-rank-tier-best .volunteer-rank-tier-title h4 {
  color: #b8860b;
}

.volunteer-rank-tier-second .volunteer-rank-tier-title h4 {
  color: #6b7280;
}

.volunteer-rank-tier-third .volunteer-rank-tier-title h4 {
  color: #92400e;
}

.volunteer-rank-tier-excellent .volunteer-rank-tier-title h4 {
  color: var(--accent-strong);
}

.volunteer-rank-cards {
  display: grid;
  gap: 10px;
}

.volunteer-rank-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.volunteer-rank-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.volunteer-rank-card-info {
  min-width: 0;
}

.volunteer-rank-card-info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.volunteer-rank-no {
  margin-right: 4px;
  color: var(--muted);
  font-weight: 700;
}

.volunteer-rank-card-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.volunteer-rank-card-stats em {
  font-style: normal;
  font-weight: 800;
  color: var(--accent-strong);
}

.volunteer-rank-empty,
.volunteer-rank-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.volunteer-rank-empty {
  padding: 18px 0 8px;
  text-align: center;
}

.volunteer-rank-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

@media (max-width: 1100px) {
  .volunteer-rank-grid {
    grid-template-columns: 1fr;
  }
}

.enroll-section-title {
  position: relative;
  margin: 24px 0 12px;
  padding-left: 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.enroll-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}

.enroll-section-title:first-of-type {
  margin-top: 0;
}

.review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.review-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.review-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.review-filter-bar:last-of-type {
  margin-bottom: 18px;
}

.review-filter-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-right: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.review-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.review-filter.active {
  background: var(--accent-soft);
  border-color: rgba(230, 46, 45, 0.22);
  color: var(--accent-strong);
}

.review-section-desc {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.participant-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.participant-badge.resident {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.participant-badge.volunteer {
  background: #edf4ff;
  color: #4b6fd6;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.enroll-table {
  margin-bottom: 8px;
}

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

.avatar-empty {
  border: 1px solid rgba(230, 46, 45, 0.18);
}

.checkin-photo-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkin-photo-links a,
.table-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.checkin-code-panel {
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  position: relative;
}

.checkin-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.checkin-print-link {
  min-width: 108px;
}

.checkin-qr-wrap-wechat {
  border-color: rgba(7, 193, 96, 0.45);
  background: rgba(7, 193, 96, 0.04);
}

.checkin-qr-wrap-scan {
  border-color: rgba(230, 46, 45, 0.45);
  background: rgba(230, 46, 45, 0.04);
}

.checkin-flow {
  display: grid;
  gap: 14px;
}

.checkin-step {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.checkin-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.checkin-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.checkin-step-head strong {
  font-size: 15px;
}

.checkin-step-desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.checkin-step-body-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.checkin-step-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.checkin-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
}

.checkin-option-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.checkin-option-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.checkin-option-or {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}

.checkin-code-display {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent-strong);
  line-height: 1.2;
}

.checkin-qr-image-wechat {
  width: 188px;
  height: 188px;
}

.checkin-qr-image-scan {
  width: 148px;
  height: 148px;
}

.checkin-qr-caption-wechat {
  color: #059669;
  font-weight: 700;
}

.checkin-qr-caption-scan {
  color: var(--accent-strong);
  font-weight: 700;
}

.checkin-refresh-form {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .checkin-step-options {
    grid-template-columns: 1fr;
  }

  .checkin-option-or {
    padding: 2px 0;
  }
}

.checkin-code-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.checkin-code-layout-dual {
  align-items: center;
}

.checkin-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.checkin-qr-caption {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.checkin-qr-wrap {
  flex-shrink: 0;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.checkin-qr-image {
  display: block;
  width: 200px;
  height: 200px;
}

.checkin-code-copy {
  flex: 1;
  min-width: 220px;
}

.checkin-code-value {
  display: inline-block;
  margin-left: 6px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent-strong);
}

.status-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  vertical-align: middle;
}

.status-cell .checkin-list-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  align-self: flex-start;
  line-height: 1;
  white-space: nowrap;
  color: var(--accent-strong);
  border-color: rgba(230, 46, 45, 0.22);
}

.application-checkin-previews {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.application-checkin-previews .checkin-thumb {
  width: 72px;
  height: 72px;
}

.application-review-form textarea[name="checkin_image"] {
  min-height: 84px;
}

.checkin-thumb {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.product-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.product-list-thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-warm);
}

.product-list-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b8a48b;
  font-size: 14px;
  font-weight: 700;
}

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-open,
.status-approved,
.status-published,
.status-completed {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-closed,
.status-rejected,
.status-cancelled {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-pending,
.status-claimed,
.status-draft,
.status-submitted {
  background: #fff3e0;
  color: var(--gold);
}

.flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
}

.flash.success {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: rgba(67, 160, 71, 0.18);
}

.flash.error {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(230, 46, 45, 0.18);
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.muted,
.subline {
  color: var(--muted);
  font-size: 12px;
}

.charts-section {
  margin-top: 0;
  padding: 22px 24px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.charts-section-compact {
  max-width: 100%;
}

.charts-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.charts-section-head h3 {
  margin: 0;
  font-size: 17px;
}

.charts-badge {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chart-card {
  padding: 10px 12px 8px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  box-shadow: none;
}

.chart-card-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.chart-card-title em {
  margin-left: 6px;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.chart-canvas-wrap {
  position: relative;
  height: 116px;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff7f2 0%, #ffffff 55%, #eef8f6 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.welcome-banner h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.welcome-banner p {
  margin: 0;
  color: var(--muted);
}

.welcome-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 32, 40, 0.48);
  backdrop-filter: blur(4px);
}

.modal-panel {
  display: block;
  width: min(920px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-panel-wide {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-subline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.enroll-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.enroll-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.enroll-toolbar .enroll-summary {
  margin-bottom: 0;
  flex: 1;
}

.enroll-table-wrap {
  overflow-x: auto;
  margin-bottom: 4px;
}

.log-filter-form {
  margin-bottom: 18px;
}

.list-search-grid {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.list-search-form .full {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .list-search-grid {
    grid-template-columns: 1fr;
  }
}

.log-filter-grid {
  align-items: end;
}

.log-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.log-table .log-time {
  white-space: nowrap;
  font-size: 13px;
}

.log-table .log-summary {
  max-width: 280px;
  word-break: break-word;
}

.log-action-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(224, 103, 85, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.log-detail-box summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.log-detail-box pre {
  margin: 8px 0 0;
  max-width: 320px;
  max-height: 180px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f8fa;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.modal-panel-narrow {
  width: min(680px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-warm);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  border: 1px solid var(--line);
}

.modal-close:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(230, 46, 45, 0.18);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.detail-block {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.detail-block > div + div {
  margin-top: 6px;
}

/* —— 登录页（独立布局，勿与后台 .card 混用） —— */
body.login-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

.login-page {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
  width: 100%;
}

.login-page-intro {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  box-sizing: border-box;
  background: linear-gradient(165deg, #3a2f2f 0%, #2f2626 55%, #1f1a1a 100%);
  color: #fff;
}

.login-page-intro-inner {
  width: 100%;
  max-width: 480px;
}

.login-page-badge {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-page-intro h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  font-weight: 800;
}

.login-page-intro p {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.72);
}

.login-page-features {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.login-page-features li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.5;
}

.login-page-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 800;
}

.login-page-form-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  box-sizing: border-box;
  background: var(--bg);
}

.login-page-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.login-page-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-page-brand .brand-mark {
  flex-shrink: 0;
}

.login-page-brand-text strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
}

.login-page-brand-text span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

body.login-body .stack-form {
  gap: 18px;
}

body.login-body .login-submit {
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
}

.login-page-footnote {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

body.login-body .flash {
  margin-bottom: 16px;
}

/* —— 后台概览页（对齐小程序社区红扁平风格） —— */
.dashboard-home {
  --dash-primary: #e62e2d;
  --dash-primary-dark: #c62828;
  --dash-primary-soft: #ffebee;
  --dash-blue: #1976d2;
  --dash-blue-soft: #e3f2fd;
  --dash-purple: #7b1fa2;
  --dash-purple-soft: #f3e5f5;
  --dash-amber: #f57c00;
  --dash-amber-soft: #fff3e0;
  --dash-green: #43a047;
  --dash-green-soft: #e8f5e9;
  --dash-ink: #333333;
  --dash-muted: #888888;
  --dash-line: #ebe3e0;
  --dash-bg: #f3eeec;
  display: grid;
  gap: 24px;
}

.dashboard-home .dash-hero {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--dash-line);
  box-shadow: var(--shadow-md);
}

.dashboard-home .dash-hero-kpi-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(165deg, var(--dash-primary) 0%, var(--dash-primary-dark) 100%);
}

.dashboard-home .dash-hero-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 88px;
  padding: 16px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-home .dash-hero-kpi:nth-child(2n) {
  border-right: 0;
}

.dashboard-home .dash-hero-kpi:nth-child(n + 3) {
  border-bottom: 0;
}

.dashboard-home .dash-hero-kpi strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.dashboard-home .dash-hero-kpi span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-home .dash-hero-body {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
  background: linear-gradient(135deg, #fff9f8 0%, var(--surface) 100%);
}

.dashboard-home .dash-hero-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--dash-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dashboard-home .dash-hero-title {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--dash-ink);
}

.dashboard-home .dash-hero-desc {
  margin: 10px 0 0;
  max-width: 520px;
  color: var(--dash-muted);
  font-size: 15px;
  line-height: 1.7;
}

.dashboard-home .dash-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.dashboard-home .dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dashboard-home .dash-btn:hover {
  transform: translateY(-1px);
}

.dashboard-home .dash-btn-primary {
  background: var(--dash-primary);
  color: #fff;
}

.dashboard-home .dash-btn-outline {
  border: 1px solid var(--dash-line);
  background: var(--surface);
  color: var(--dash-ink);
}

.dashboard-home .dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-home .dash-metric {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--dash-line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-home .dash-metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dashboard-home .dash-metric-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-home .dash-metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.dashboard-home .dash-metric h3 {
  margin: 0;
  color: var(--dash-muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-home .dash-metric-value {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--dash-ink);
}

.dashboard-home .dash-metric-note {
  color: var(--dash-muted);
  font-size: 12px;
}

.dashboard-home .dash-metric-red .dash-metric-icon { background: var(--dash-primary-soft); }
.dashboard-home .dash-metric-red .dash-metric-value { color: var(--dash-primary); }
.dashboard-home .dash-metric-blue .dash-metric-icon { background: var(--dash-blue-soft); }
.dashboard-home .dash-metric-blue .dash-metric-value { color: var(--dash-blue); }
.dashboard-home .dash-metric-purple .dash-metric-icon { background: var(--dash-purple-soft); }
.dashboard-home .dash-metric-purple .dash-metric-value { color: var(--dash-purple); }
.dashboard-home .dash-metric-amber .dash-metric-icon { background: var(--dash-amber-soft); }
.dashboard-home .dash-metric-amber .dash-metric-value { color: var(--dash-amber); }
.dashboard-home .dash-metric-green .dash-metric-icon { background: var(--dash-green-soft); }
.dashboard-home .dash-metric-green .dash-metric-value { color: var(--dash-green); }

.dashboard-home .dash-section,
.dashboard-home .dash-panel {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--dash-line);
  box-shadow: var(--shadow-sm);
}

.dashboard-home .dash-section {
  padding: 24px 24px 20px;
}

.dashboard-home .dash-section-head,
.dashboard-home .dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-home .dash-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dashboard-home .dash-section-bar {
  width: 4px;
  height: 22px;
  margin-top: 3px;
  border-radius: 2px;
  background: var(--dash-primary);
  flex-shrink: 0;
}

.dashboard-home .dash-section-title h3,
.dashboard-home .dash-panel-head h3 {
  margin: 0;
  color: var(--dash-ink);
  font-size: 20px;
  font-weight: 800;
}

.dashboard-home .dash-panel-head p {
  margin: 6px 0 0;
  color: var(--dash-muted);
  font-size: 13px;
}

.dashboard-home .dash-section-tag {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--dash-primary-soft);
  color: var(--dash-primary);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-home .dash-participation-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-home .dash-participation-stat {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--dash-line);
  background: linear-gradient(180deg, #fff 0%, var(--bg-warm) 100%);
  box-shadow: var(--shadow-sm);
}

.dashboard-home .dash-participation-stat::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.dashboard-home .dash-participation-stat-resident::after {
  background: var(--dash-primary);
}

.dashboard-home .dash-participation-stat-volunteer::after {
  background: var(--dash-blue);
}

.dashboard-home .dash-participation-stat-peak::after {
  background: var(--dash-purple);
}

.dashboard-home .dash-participation-stat-label {
  display: block;
  color: var(--dash-muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-home .dash-participation-stat-value {
  display: block;
  margin-top: 8px;
  color: var(--dash-ink);
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
}

.dashboard-home .dash-participation-stat-resident .dash-participation-stat-value {
  color: var(--dash-primary);
}

.dashboard-home .dash-participation-stat-volunteer .dash-participation-stat-value {
  color: var(--dash-blue);
}

.dashboard-home .dash-participation-stat-peak .dash-participation-stat-value {
  font-size: 22px;
  color: var(--dash-purple);
}

.dashboard-home .dash-participation-stat-note {
  display: block;
  margin-top: 8px;
  color: var(--dash-muted);
  font-size: 12px;
}

.dashboard-home .dash-chart-card-featured {
  padding: 20px 20px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fffaf9 100%);
  border: 1px solid rgba(230, 46, 45, 0.12);
  box-shadow: var(--shadow-sm);
}

.dashboard-home .dash-chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.dashboard-home .dash-chart-subtitle {
  margin: 6px 0 0;
  color: var(--dash-muted);
  font-size: 12px;
}

.dashboard-home .dash-chart-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--dash-muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-home .dash-chart-legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-home .dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dashboard-home .dash-legend-dot-resident {
  background: #e62e2d;
}

.dashboard-home .dash-legend-dot-volunteer {
  background: #1976d2;
}

.dashboard-home .dash-chart-card-head .dash-chart-title {
  margin: 0;
}

.dashboard-home .dash-chart-canvas-lg {
  height: 260px;
}

.dashboard-home .dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-home .dash-chart-card {
  padding: 18px 18px 14px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1px solid var(--dash-line);
}

.dashboard-home .dash-chart-title {
  margin: 0 0 12px;
  color: var(--dash-ink);
  font-size: 14px;
  font-weight: 700;
}

.dashboard-home .dash-chart-canvas {
  position: relative;
  height: 200px;
}

.dashboard-home .dash-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-home .dash-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--dash-line);
  color: var(--dash-ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.dashboard-home .dash-quick-btn:hover {
  border-color: var(--dash-primary);
  color: var(--dash-primary);
}

.dashboard-home .dash-panels {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}

.dashboard-home .dash-panel {
  padding: 22px 22px 18px;
  overflow: auto;
}

.dashboard-home .dash-panel table {
  width: 100%;
}

.dashboard-home .dash-beian {
  margin-top: 8px;
  padding: 16px 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dashboard-home .dash-beian a {
  color: inherit;
  text-decoration: none;
}

.dashboard-home .dash-beian a:hover {
  color: var(--dash-primary);
  text-decoration: underline;
}

.dashboard-home .dash-panel .empty {
  color: var(--dash-muted);
}

@media (max-width: 1280px) {
  .dashboard-home .dash-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .settings-grid,
  .two-column,
  .info-grid,
  .charts-grid,
  .dashboard-home .dash-charts,
  .dashboard-home .dash-panels,
  .dashboard-home .dash-participation-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-home .dash-chart-card-head {
    flex-direction: column;
  }

  .chart-canvas-wrap {
    height: 180px;
  }

  .dashboard-home .dash-chart-canvas {
    height: 180px;
  }
}

@media (max-width: 960px) {
  .layout {
    display: block;
  }

  .sidebar {
    width: auto;
  }

  html.sidebar-collapsed-boot .sidebar,
  .layout.sidebar-collapsed .sidebar {
    width: auto;
    padding-left: 14px;
    padding-right: 14px;
  }

  html.sidebar-collapsed-boot .nav,
  .layout.sidebar-collapsed .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  html.sidebar-collapsed-boot .nav a,
  .layout.sidebar-collapsed .nav a {
    flex: 0 0 auto;
    min-width: 44px;
  }

  html.sidebar-hidden-boot .sidebar,
  .layout.sidebar-hidden .sidebar {
    display: none;
  }

  .sidebar-reopen-btn {
    top: 18px;
    transform: none;
  }

  .main {
    padding: 18px;
  }

  .login-page {
    flex-direction: column;
  }

  .login-page-intro {
    flex: none;
    padding: 36px 24px;
  }

  .login-page-intro h1 {
    font-size: 28px;
  }

  .login-page-form-side {
    flex: 1;
    padding: 24px 20px 32px;
  }

  .form-grid,
  .verify-form,
  .compact-form {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .welcome-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-home .dash-hero {
    flex-direction: column;
  }

  .dashboard-home .dash-hero-kpi-panel {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-home .dash-hero-kpi {
    min-height: 72px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 0;
  }

  .dashboard-home .dash-hero-kpi:nth-child(2n) {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dashboard-home .dash-hero-kpi:last-child {
    border-right: 0;
  }

  .dashboard-home .dash-hero-body {
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
  }

  .dashboard-home .dash-hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dashboard-home .dash-hero-title {
    font-size: 28px;
  }

  .dashboard-home .dash-metrics {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }

  .mini-qr-float {
    right: 12px;
    bottom: 12px;
  }

  .mini-qr-card {
    width: min(220px, calc(100vw - 24px));
  }
}

.mini-qr-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  pointer-events: none;
}

.mini-qr-float:not([hidden]) {
  pointer-events: auto;
}

.mini-qr-card {
  position: relative;
  width: 220px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(24, 32, 40, 0.22);
  text-align: center;
}

.mini-qr-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-qr-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.mini-qr-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.mini-qr-tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
