body { background: #f1f5f9; }

.admin-header {
  background: #0f172a;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
.admin-header .bar {
  width: min(1180px, 100% - 28px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 58px;
}
.admin-header .logo { font-weight: 700; font-size: 17px; white-space: nowrap; }
.admin-header nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.admin-header nav a {
  color: rgba(255, 255, 255, 0.72);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.admin-header nav a:hover { background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.admin-header nav a.on { background: rgba(255, 255, 255, 0.16); color: #fff; }
.admin-header .who { font-size: 12px; color: rgba(255, 255, 255, 0.6); }

.admin-main { width: min(1180px, 100% - 28px); margin: 20px auto 0; display: grid; gap: 16px; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-shell .card { width: min(400px, 100%); }
.login-shell h1 { font-size: 22px; margin-bottom: 4px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted); }

.card h2 { font-size: 18px; }
.card h2 + .muted { margin-top: 2px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
}
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.table-wrap { overflow-x: auto; }
td .route { font-size: 13px; line-height: 1.5; }
td .route b { font-weight: 600; }
td .sub { color: var(--muted); font-size: 12px; }
td .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }

/* 日期区间、复选项、报表小字 */
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; }
.check input { width: 18px; height: 18px; }
.range-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.range-bar .field { margin: 0; min-width: 150px; }
.range-bar .btn { height: 40px; }
.table-note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.amount { font-variant-numeric: tabular-nums; }
.amount.strong { font-weight: 700; }

dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(460px, calc(100% - 28px));
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.dialog-body { padding: 20px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.hint-line {
  display: block;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  margin-top: 5px;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 4px;
}
.switch-row label { cursor: pointer; flex: 1 1 180px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  font-weight: 600;
}
.switch-row span small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch-row input:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.form-grid .field.full { grid-column: 1 / -1; }

.history { list-style: none; padding: 0; margin: 10px 0 0; }
.history li {
  border-bottom: 1px dashed var(--line);
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
}
.history li b { color: var(--ink); }

.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.venue-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.venue-card img { width: 100%; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.venue-card .name { font-weight: 700; font-size: 16px; }
.venue-card .url { word-break: break-all; font-size: 11px; color: var(--muted); margin: 6px 0; }
.venue-card .ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 0 30px; }

@media print {
  .admin-header, .no-print { display: none !important; }
  .admin-main { width: 100%; margin: 0; }
  .venue-grid { grid-template-columns: 1fr 1fr; }
  .venue-card { break-inside: avoid; page-break-inside: avoid; }
  .venue-card .qr-wrap { text-align: center; }
  .venue-card img { width: 240px; }
}
