:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #e3e8f1;
  --line-strong: #d4ddea;
  --text: #172033;
  --muted: #5d6b82;
  --subtle: #8a97aa;
  --primary: #2364d2;
  --primary-2: #3b82f6;
  --primary-soft: #e8f1ff;
  --cyan: #0891b2;
  --cyan-soft: #e7f8fc;
  --green: #16a34a;
  --green-soft: #e9f8ef;
  --amber: #b7791f;
  --amber-soft: #fff5df;
  --red: #dc2626;
  --red-soft: #fff0f0;
  --violet: #7c3aed;
  --violet-soft: #f3eefe;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 10px 30px rgba(31, 45, 70, .08);
  --radius: 8px;
  --sidebar: 248px;
  --sidebar-collapsed: 76px;
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

body.theme-dark {
  --bg: #07111f;
  --surface: #0f1c2f;
  --surface-soft: #13243a;
  --line: #243852;
  --line-strong: #31506f;
  --text: #e7eef9;
  --muted: #a9b7ca;
  --subtle: #7e8fa8;
  --primary: #4aa3ff;
  --primary-2: #22d3ee;
  --primary-soft: rgba(74, 163, 255, .16);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, .14);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .16);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .16);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .26);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: var(--font); color: var(--text); background: var(--bg); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.icon { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }
.icon-lg { width: 22px; height: 22px; }
.login-screen {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 14vh 24px 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(53, 156, 255, .55) 0 1px, transparent 2px),
    radial-gradient(circle at 24% 24%, rgba(255, 255, 255, .45) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 10%, rgba(53, 156, 255, .46) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 28%, rgba(255, 255, 255, .38) 0 1px, transparent 2px),
    radial-gradient(circle at 16% 62%, rgba(53, 156, 255, .42) 0 1px, transparent 2px),
    linear-gradient(180deg, #02030a 0%, #050817 52%, #030712 100%);
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 111, 196, .14) 0 1px, transparent 1px 120px),
    linear-gradient(0deg, rgba(9, 111, 196, .1) 0 1px, transparent 1px 120px);
  opacity: .22;
}
.login-screen::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -430px;
  width: min(980px, 86vw);
  height: 620px;
  transform: translateX(-50%);
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .96) 0 1.5%, rgba(72, 185, 255, .95) 2.5%, rgba(20, 71, 110, .9) 11%, rgba(6, 16, 34, .98) 29%, rgba(5, 8, 18, .45) 48%, transparent 70%);
  box-shadow: 0 -18px 70px rgba(64, 169, 255, .42);
}
.login-brand-panel {
  position: relative;
  z-index: 1;
  width: min(840px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.brand-lockup { display: flex; align-items: center; justify-content: center; }
.brand-mark {
  width: 160px;
  height: 108px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .28), 0 0 28px rgba(28, 158, 210, .22);
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}
.brand-title,
.brand-subtitle,
.login-metrics,
.login-footer { display: none; }
.login-copy { max-width: 840px; }
.login-copy h1 {
  margin: 0;
  color: #fff;
  font-size: 42px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .48);
}
.login-copy p {
  margin: 16px 0 0;
  color: rgba(229, 241, 255, .76);
  line-height: 1.5;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 4px;
}
.login-form-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: min(440px, 100%);
  margin-top: 36px;
}
.login-card {
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.login-card h2 { margin: 0 0 18px; color: #fff; font-size: 18px; text-align: center; letter-spacing: 8px; }
.login-card .hint { display: none; }
.field { display: block; margin-bottom: 16px; position: relative; }
.field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(143, 164, 204, .42);
  border-radius: 999px;
  color: rgba(224, 235, 255, .86);
  background: rgba(3, 6, 18, .46);
  box-shadow: inset 0 0 18px rgba(14, 24, 54, .55);
}
.input-wrap:focus-within { border-color: rgba(76, 183, 255, .9); box-shadow: 0 0 0 3px rgba(20, 132, 219, .16), inset 0 0 18px rgba(14, 24, 54, .55); }
.input-wrap input { border: 0; outline: 0; width: 100%; min-width: 0; color: #fff; background: transparent; font-weight: 700; }
.input-wrap input::placeholder { color: rgba(225, 235, 255, .52); }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 122px; gap: 10px; }
.captcha-box {
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #1265c7;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}
.login-submit { width: 100%; height: 48px; margin-top: 8px; }
.auth-message { min-height: 20px; margin-top: 14px; color: rgba(231, 241, 255, .8); font-size: 13px; font-weight: 700; text-align: center; }
.auth-message.error { color: #ffb4b4; }
body.auth-pending .app-shell,
body.login-required .app-shell { display: none; }
body.authenticated .login-screen { display: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
body.nav-collapsed .app-shell { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

.sidebar {
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.side-head { height: 64px; padding: 0 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.side-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  background: #fff;
  overflow: hidden;
  border: 1px solid rgba(212, 221, 234, .8);
}
.side-logo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; }
.side-title { min-width: 0; }
.side-title strong { display: block; font-size: 16px; white-space: nowrap; }
.side-title span { color: var(--subtle); font-size: 11px; white-space: nowrap; }
.nav { padding: 16px 12px; overflow: auto; flex: 1; }
.nav-section-label { color: var(--subtle); font-size: 12px; font-weight: 800; padding: 10px 10px 8px; }
.nav-item {
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: #42516a;
  background: transparent;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: left;
  position: relative;
  user-select: none;
  touch-action: manipulation;
}
.nav-item .icon, .nav-item span { pointer-events: none; }
.nav-item.active { background: var(--primary-soft); border-color: #d4e4ff; color: var(--primary); }
.nav-item:hover { background: #f2f6fb; border-color: var(--line); transform: translateX(1px); }
.nav-item:focus-visible { outline: 3px solid rgba(35, 100, 210, .18); outline-offset: 2px; }
.side-foot { border-top: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sync-pill {
  padding: 12px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  align-items: center;
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.sync-pill.warning .sync-dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.sync-pill.failed .sync-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.sync-pill strong { display: block; font-size: 13px; }
.sync-pill span { color: var(--subtle); font-size: 11px; }
.theme-toggle {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #344052;
  background: #fff;
  font-weight: 900;
  text-align: left;
  user-select: none;
  touch-action: manipulation;
}
.theme-toggle:hover { border-color: #cfe0ff; background: #f7fbff; }
.theme-toggle:focus-visible { outline: 3px solid rgba(35, 100, 210, .18); outline-offset: 2px; }
.theme-toggle-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  flex: 0 0 auto;
}
.theme-toggle-label { pointer-events: none; }
.side-foot .admin-nav { margin: 0; }
body.nav-collapsed .side-title,
body.nav-collapsed .nav-section-label,
body.nav-collapsed .nav-item span,
body.nav-collapsed .sync-pill div,
body.nav-collapsed .theme-toggle-label { display: none; }
body.nav-collapsed .nav-item { justify-content: center; padding: 0; }
body.nav-collapsed .sync-pill { justify-content: center; padding: 12px 0; }
body.nav-collapsed .theme-toggle { justify-content: center; padding: 0; }

body.theme-dark.authenticated { background: var(--bg); color: var(--text); }
body.theme-dark .sidebar { background: #0b1627; border-color: var(--line); }
body.theme-dark .side-head,
body.theme-dark .side-foot,
body.theme-dark .panel-head,
body.theme-dark .table-foot { border-color: var(--line); }
body.theme-dark .side-logo { background: #eef5ff; border-color: rgba(74, 163, 255, .24); }
body.theme-dark .side-title strong,
body.theme-dark .page-title strong,
body.theme-dark .overview-total strong,
body.theme-dark .overview-mini strong,
body.theme-dark .sector-title strong,
body.theme-dark .sector-revenue strong,
body.theme-dark .kpi-value,
body.theme-dark .panel-title,
body.theme-dark .admin-hero h2,
body.theme-dark .admin-card strong,
body.theme-dark .repurchase-kpi strong,
body.theme-dark .rank-main strong,
body.theme-dark .rank-value,
body.theme-dark td strong { color: var(--text); }
body.theme-dark .nav-item { color: #c7d4e8; }
body.theme-dark .nav-item.active { background: var(--primary-soft); border-color: rgba(74, 163, 255, .32); color: #8ed2ff; }
body.theme-dark .nav-item:hover { background: #11243b; border-color: #28435f; }
body.theme-dark .sync-pill,
body.theme-dark .theme-toggle,
body.theme-dark .search-box,
body.theme-dark .secondary-btn,
body.theme-dark .ghost-btn,
body.theme-dark .icon-btn,
body.theme-dark .date-field,
body.theme-dark .select-field,
body.theme-dark .segmented button.active { background: var(--surface); border-color: var(--line); color: #d9e6f7; }
body.theme-dark .theme-toggle:hover,
body.theme-dark .secondary-btn:hover,
body.theme-dark .ghost-btn:hover,
body.theme-dark .icon-btn:hover { background: #13243a; border-color: #31506f; }
body.theme-dark .theme-toggle-icon { color: #fbbf24; background: rgba(251, 191, 36, .18); }
body.theme-dark .topbar { background: rgba(7, 17, 31, .9); border-color: var(--line); }
body.theme-dark .search-box input,
body.theme-dark .date-field input,
body.theme-dark .select-field select { color: var(--text); }
body.theme-dark .search-box input::placeholder { color: #7789a3; }
body.theme-dark .user-chip,
body.theme-dark .overview-period-label,
body.theme-dark .date-field input,
body.theme-dark .select-field select,
body.theme-dark td { color: #cbd8ea; }
body.theme-dark .filter-bar,
body.theme-dark .overview-total,
body.theme-dark .overview-mini,
body.theme-dark .sector-card,
body.theme-dark .panel { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
body.theme-dark .sector-card.clickable:hover { border-color: rgba(74, 163, 255, .42); box-shadow: var(--shadow-md); }
body.theme-dark .sector-metric,
body.theme-dark .repurchase-kpi,
body.theme-dark .rank-index { background: var(--surface-soft); border-color: #1e3450; }
body.theme-dark .segmented { background: #0b1627; border-color: var(--line); }
body.theme-dark .segmented button { color: var(--muted); }
body.theme-dark .notice { background: rgba(251, 191, 36, .11); border-color: rgba(251, 191, 36, .24); color: #f8d987; }
body.theme-dark .admin-hero { background: linear-gradient(135deg, #0f1c2f 0%, #132a46 58%, #102f3c 100%); border-color: var(--line); box-shadow: var(--shadow-sm); }
body.theme-dark .rank-row,
body.theme-dark .scenic-performance-row,
body.theme-dark td,
body.theme-dark th { border-color: #1e3450; }
body.theme-dark th { background: #111f33; color: var(--muted); }
body.theme-dark .table-wrap { background: var(--surface); }
body.theme-dark .bar-track,
body.theme-dark .scenic-bar-track { background: #1e3450; }
body.theme-dark .scenic-performance-header { background: #111f33; }
body.theme-dark .avatar { background: linear-gradient(145deg, rgba(74, 163, 255, .22), rgba(34, 211, 238, .18)); color: #8ed2ff; }

.content { height: 100vh; overflow: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 64px;
  background: rgba(245, 247, 251, .9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}
.top-left, .top-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title strong { display: block; font-size: 18px; white-space: nowrap; }
.page-title span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.search-box {
  height: 36px;
  width: 360px;
  max-width: 30vw;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  background: #fff;
}
.search-box input { border: 0; outline: 0; width: 100%; background: transparent; color: var(--text); min-width: 0; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #dbeafe, #cffafe);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 900;
}
.user-chip { display: flex; align-items: center; gap: 9px; color: #344052; font-weight: 700; white-space: nowrap; }

.primary-btn, .secondary-btn, .ghost-btn, .icon-btn {
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
}
.primary-btn {
  border: 0;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 22px rgba(35, 100, 210, .2);
}
.primary-btn.login-submit { height: 48px; width: 100%; }
.secondary-btn, .ghost-btn, .icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #344052;
  padding: 0 12px;
}
.ghost-btn { background: transparent; }
.icon-btn { width: 36px; padding: 0; }
.compact-btn { padding: 0 11px; }
button:disabled { cursor: not-allowed; opacity: .45; }

.dashboard { padding: 14px 20px 18px; min-width: 1080px; }
.view-panel[hidden] { display: none; }
#dashboardTop,
#overviewTop,
#parkingTop,
#adminTop,
.sector-card,
.panel,
.sync-pill { scroll-margin-top: 82px; }
.nav-highlight {
  animation: navFlash 1.1s ease;
}
@keyframes navFlash {
  0% { box-shadow: 0 0 0 0 rgba(35, 100, 210, .28); border-color: rgba(35, 100, 210, .45); }
  70% { box-shadow: 0 0 0 8px rgba(35, 100, 210, 0); border-color: rgba(35, 100, 210, .18); }
  100% { box-shadow: var(--shadow-sm); }
}
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.filter-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.filter-actions .ghost-btn,
.filter-actions .primary-btn {
  min-width: 78px;
  padding: 0 14px;
}
.date-field, .select-field {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #fff;
}
.date-field span, .select-field span { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.date-field input, .select-field select {
  border: 0;
  outline: 0;
  color: #344052;
  background: transparent;
  min-width: 116px;
  height: 32px;
  font-weight: 700;
}
.select-field select { min-width: 112px; }
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fafc;
}
.segmented button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
}
.segmented button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }
.quick-range { flex: 0 0 auto; }
.quick-range button { padding: 0 10px; }
.notice {
  margin-bottom: 12px;
  border: 1px solid var(--amber-soft);
  background: #fffbeb;
  color: #8a5b12;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.overview-filter { margin-bottom: 14px; }
.overview-period-label {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344052;
  font-weight: 900;
}
.overview-summary {
  display: grid;
  grid-template-columns: 1.4fr .8fr .8fr;
  gap: 12px;
  margin-bottom: 12px;
}
.overview-total,
.overview-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.overview-total span,
.overview-mini span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.overview-total strong { display: block; margin-top: 8px; font-size: 34px; line-height: 1.1; }
.overview-mini strong { display: block; margin-top: 8px; font-size: 27px; line-height: 1.1; }
.overview-total small,
.overview-mini small { display: block; color: var(--subtle); font-size: 12px; margin-top: 8px; }

.sector-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sector-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 15px;
  min-height: 178px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  cursor: default;
}
.sector-card.clickable { cursor: pointer; }
.sector-card.clickable:hover { border-color: #bad2ff; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sector-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sector-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sector-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}
.sector-title strong { display: block; font-size: 16px; }
.sector-title span { display: block; margin-top: 3px; color: var(--subtle); font-size: 12px; }
.sector-status {
  height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  background: #eef4ff;
  color: var(--primary);
}
.sector-status.pending { background: var(--amber-soft); color: var(--amber); }
.sector-status.empty { background: #f1f5f9; color: var(--muted); }
.sector-revenue strong { display: block; font-size: 28px; line-height: 1.1; }
.sector-revenue span { display: block; color: var(--subtle); font-size: 12px; margin-top: 6px; }
.sector-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sector-metric { background: var(--surface-soft); border: 1px solid #edf1f6; border-radius: 7px; padding: 8px; min-width: 0; }
.sector-metric strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sector-metric span { display: block; margin-top: 3px; color: var(--subtle); font-size: 11px; }
.overview-grid {
  display: grid;
  grid-template-columns: 1.34fr .9fr;
  grid-auto-rows: 320px;
  gap: 16px;
}

.kpi-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 13px 14px;
  min-height: 108px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--accent, var(--primary)); }
.kpi-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 900; }
.kpi-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--soft, var(--primary-soft)); color: var(--accent, var(--primary)); }
.kpi-value { margin-top: 10px; font-size: 23px; font-weight: 900; letter-spacing: 0; white-space: nowrap; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--subtle); font-size: 12px; }
.trend-up { color: var(--green); font-weight: 900; }
.trend-down { color: var(--red); font-weight: 900; }
.trend-flat { color: var(--subtle); font-weight: 900; }

.scenic-performance-panel { margin-bottom: 16px; }
.scenic-performance-panel .panel-head { height: 56px; }
.scenic-performance-panel .panel-head > div:first-child { min-width: 0; }
.scenic-performance-note { display: block; margin: 3px 0 0 27px; color: var(--subtle); font-size: 11px; }
.scenic-performance-legend { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.scenic-performance-legend span { display: inline-flex; align-items: center; gap: 7px; }
.scenic-performance-legend i { width: 18px; height: 6px; border-radius: 3px; background: var(--primary-2); }
.scenic-performance-legend i.tickets { background: var(--green); }
.scenic-performance-scroll { max-height: 264px; overflow: auto; }
.scenic-performance-grid {
  min-width: 840px;
  display: grid;
  grid-template-columns: 48px minmax(112px, .65fr) minmax(210px, 1.35fr) 86px minmax(210px, 1.2fr) 76px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.scenic-performance-header { min-height: 34px; background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 900; }
.scenic-performance-row { min-height: 52px; border-top: 1px solid #edf1f6; }
.scenic-performance-row:first-child { border-top: 0; }
.scenic-performance-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 900;
}
.scenic-performance-row:nth-child(1) .scenic-performance-rank { color: #8b5d00; background: var(--amber-soft); }
.scenic-performance-name { min-width: 0; font-size: 13px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scenic-performance-row.unclassified .scenic-performance-name { color: var(--subtle); }
.scenic-metric { min-width: 0; display: flex; align-items: center; gap: 10px; }
.scenic-bar-track { flex: 1; min-width: 64px; height: 8px; overflow: hidden; border-radius: 4px; background: #eef2f7; }
.scenic-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary-2); }
.scenic-bar-track.tickets i { background: var(--green); }
.scenic-metric strong { min-width: 74px; text-align: right; font-size: 13px; white-space: nowrap; }
.scenic-share { text-align: right; font-size: 12px; font-weight: 900; white-space: nowrap; }
.scenic-performance-empty { min-height: 104px; display: grid; place-items: center; color: var(--subtle); font-size: 13px; }

.parking-kpi-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.parking-kpi-card .kpi-value { font-size: 21px; overflow: hidden; text-overflow: ellipsis; }
.parking-kpi-card .kpi-foot { justify-content: flex-start; min-height: 16px; }
.parking-filter-bar .select-field select { max-width: 180px; }
.parking-park-list { height: calc(100% - 48px); overflow: auto; padding: 10px 14px; }
.parking-park-row { padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.parking-park-row:last-child { border-bottom: 0; }
.parking-park-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parking-park-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.parking-park-head span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.parking-park-metrics { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--subtle); font-size: 11px; white-space: nowrap; }
.parking-park-metrics span { display: inline-flex; align-items: center; gap: 5px; }
.parking-park-metrics i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.parking-park-metrics i.exit { background: var(--cyan); }
.parking-park-metrics i.space { background: var(--amber); }
.parking-flow-track { height: 5px; margin-top: 9px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
.parking-flow-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--cyan)); }
.parking-panel-empty { height: 100%; display: grid; place-items: center; color: var(--subtle); font-size: 13px; text-align: center; }
.parking-table-panel { grid-column: 1 / 4; }
.parking-table { min-width: 1180px; }
.parking-table td:nth-child(3) { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }

.chart-grid {
  display: grid;
  grid-template-columns: 1.36fr .86fr .86fr;
  grid-auto-rows: 292px;
  gap: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}
.panel-wide { grid-column: span 2; }
.table-panel { grid-column: 1 / 4; height: 440px; display: grid; grid-template-rows: 48px minmax(0, 1fr) 46px; }
.panel-head {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.panel-title { display: flex; align-items: center; gap: 9px; font-weight: 900; min-width: 0; white-space: nowrap; }
.panel-title .icon { color: var(--primary); }
.panel-note { color: var(--subtle); font-size: 12px; white-space: nowrap; }
.panel-actions { display: flex; gap: 8px; }
.panel-actions .ghost-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.chart { height: calc(100% - 48px); min-height: 0; }

.admin-view { min-width: 980px; }
.admin-hero {
  min-height: 170px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 58%, #e8fbfb 100%);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.admin-eyebrow { display: block; color: var(--primary); font-size: 13px; font-weight: 900; margin-bottom: 8px; }
.admin-hero h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.admin-hero p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; max-width: 660px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.admin-card { padding: 20px; min-height: 178px; }
.admin-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  margin-bottom: 18px;
}
.admin-card-icon.green { color: var(--green); background: var(--green-soft); }
.admin-card-icon.amber { color: var(--amber); background: var(--amber-soft); }
.admin-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; }
.admin-card strong { display: block; margin-top: 8px; font-size: 25px; line-height: 1.15; }
.admin-card small { display: block; margin-top: 8px; color: var(--subtle); font-size: 12px; }

.rank-list { height: calc(100% - 48px); overflow: auto; padding: 12px 14px; }
.repurchase-list { height: calc(100% - 48px); overflow: auto; padding: 12px 14px; }
.repurchase-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.repurchase-kpi { border: 1px solid #edf1f6; background: var(--surface-soft); border-radius: 7px; padding: 8px; }
.repurchase-kpi strong { display: block; font-size: 17px; }
.repurchase-kpi span { display: block; color: var(--subtle); font-size: 11px; margin-top: 2px; }
.rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f6;
}
.rank-row:last-child { border-bottom: 0; }
.rank-index {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--primary);
  font-weight: 900;
  font-size: 12px;
}
.rank-main strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-main span { color: var(--subtle); font-size: 11px; }
.rank-value { font-weight: 900; font-size: 13px; white-space: nowrap; }
.bar-track { margin-top: 7px; height: 5px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--cyan)); border-radius: inherit; }

.table-wrap { overflow: auto; padding: 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  height: 38px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  z-index: 1;
}
td { height: 42px; border-bottom: 1px solid #edf1f6; color: #344052; white-space: nowrap; }
td strong { color: var(--text); }
.tag {
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.empty-cell { text-align: center; color: var(--subtle); padding: 36px 0; }
.table-foot {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.pager { display: flex; align-items: center; gap: 10px; }

.loading .panel,
.loading .kpi-card { opacity: .62; }

@media (max-width: 1500px) {
  .dashboard { min-width: 0; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 300px; }
  .panel-wide, .table-panel { grid-column: 1 / 3; }
  .sector-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1200px) {
  .scenic-performance-grid {
    min-width: 700px;
    grid-template-columns: 40px minmax(90px, .62fr) minmax(150px, 1.25fr) 70px minmax(150px, 1.12fr) 64px;
    gap: 8px;
    padding: 0 12px;
  }
  .scenic-metric { gap: 7px; }
  .scenic-metric strong { min-width: 64px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .login-screen { padding: 10vh 18px 0; }
  .brand-mark { width: 132px; height: 90px; }
  .brand-mark img { height: 100%; }
  .login-copy h1 { font-size: 28px; }
  .login-copy p { font-size: 11px; letter-spacing: 2px; }
  .login-form-panel { width: min(410px, 100%); margin-top: 28px; }
  .login-card { padding: 0; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { height: auto; min-height: 100vh; }
  .dashboard, .admin-view { min-width: 0; padding: 14px; }
  .topbar { padding: 0 14px; }
  .top-right .secondary-btn, .user-chip { display: none; }
  .search-box { width: 240px; max-width: 42vw; }
  .filter-bar { align-items: flex-start; flex-direction: column; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenic-performance-legend { gap: 10px; }
  .overview-summary { grid-template-columns: 1fr; }
  .sector-grid { grid-template-columns: 1fr; }
  .overview-grid { display: block; }
  .chart-grid { display: block; }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .admin-grid { grid-template-columns: 1fr; }
  .panel { height: 320px; margin-bottom: 14px; }
  .admin-card { height: auto; }
  .table-panel { height: 420px; }
}
