:root {
  color-scheme: light;
  /* === 主题层：TailAdmin 风格的浅灰后台底色 + 明亮蓝主色 === */
  --bg: #f9fafb;
  --panel: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --line-soft: #f2f4f7;
  --line-strong: #d0d5dd;
  --blue: #465fff;
  --blue-soft: #eef4ff;
  --accent-fg: #ffffff;
  --blue-info: #465fff;
  --purple: #7c3aed;
  --green: #0f7b55;
  --green-soft: #e9f6f0;
  --amber: #946800;
  --amber-soft: #fdf3da;
  --red: #d12c2c;
  --red-soft: #fdeaea;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0a0a0a;
  --surface-2: #111111;
  --surface-3: #1a1a1a;
  --text: #ededed;
  --text-2: #c2c2c2;
  --muted: #8f8f8f;
  --muted-2: #6b6b6b;
  --line: #232323;
  --line-soft: #1a1a1a;
  --line-strong: #2e2e2e;
  --blue: #ededed;
  --blue-soft: #1f1f1f;
  --accent-fg: #000000;
  --blue-info: #3b9eff;
  --purple: #a78bfa;
  --green: #3ad29f;
  --green-soft: #11241d;
  --amber: #e3b341;
  --amber-soft: #2a2210;
  --red: #ff6166;
  --red-soft: #2d1416;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  outline: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.login-remember input {
  width: auto;
  margin: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--surface-3), transparent 60%),
    var(--bg);
}

.login-panel {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.login-panel .eyebrow {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.login-panel h1 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.login-sub {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

/* === 小鹅 logo === */
.goose-logo {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 50% 20%, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
}

.goose-lg {
  width: 60px;
  height: 60px;
  padding: 6px;
  box-shadow: var(--shadow-card);
}

.goose-sm {
  width: 38px;
  height: 38px;
  padding: 3px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-view {
  display: flex;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  flex: none;
  width: 208px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand strong {
  font-size: 16px;
  font-weight: 800;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-label {
  margin: 14px 8px 4px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nav-item.active {
  background: var(--blue);
  color: var(--accent-fg);
}

.nav-ico {
  width: 20px;
  height: 20px;
  display: inline-grid;
  flex: none;
  place-items: center;
  color: currentColor;
}

.nav-ico svg,
.vb-ico svg,
.nav-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.sub {
  padding-left: 18px;
  font-size: 13px;
  min-height: 36px;
}

.nav-item.soon {
  color: var(--muted-2);
  cursor: default;
}

.nav-item.soon:hover {
  background: transparent;
  color: var(--muted-2);
}

.nav-soon {
  margin-left: auto;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.nav-group-toggle:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nav-caret {
  margin-left: auto;
  font-size: 11px;
  transition: transform 180ms ease;
}

.nav-group-toggle[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

.nav-drawer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px 20px;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
}

.topbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
}

.topbar h1 {
  font-size: 22px;
}

.topbar-actions,
.board-actions,
.dialog-actions,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filters {
  flex-wrap: wrap;
}

.filters input {
  width: 260px;
}

.filters select {
  width: 132px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filters button {
  min-height: 34px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.quick-filters button.active {
  background: var(--text);
  color: var(--panel);
}

.primary,
.secondary,
.ghost,
.icon {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary {
  background: var(--blue);
  color: var(--accent-fg);
}

.secondary {
  background: var(--blue-soft);
  color: var(--blue);
}

.cta-large {
  min-width: 112px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 850;
}

.ghost {
  background: transparent;
  color: var(--muted);
}

.ghost:hover {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn {
  width: 40px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.danger {
  color: var(--red);
}

.icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: var(--surface-3);
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

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

.map-section,
.table-section,
.visit-plan-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.section-head p {
  color: var(--muted);
  font-size: 13px;
}

.map-section,
.table-section,
.visit-plan-section {
  margin-bottom: 14px;
  overflow: hidden;
}

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

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.invite-code-copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.map-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: minmax(0, 1fr);
  background: #e7effa;
}

[data-theme="dark"] .map-section {
  background: #06111f;
}

.map-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
}

.region-panel {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  width: 380px;
  border-left: 1px solid #c9d8ea;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fbff;
}

[data-theme="dark"] .region-panel {
  border-left-color: #17304e;
  background: #071526;
}

.region-panel-head {
  flex: none;
  padding: 14px 16px;
  border-bottom: 1px solid #d7e4f3;
  background: #ffffff;
}

[data-theme="dark"] .region-panel-head {
  border-bottom-color: #17304e;
  background: #0a1b30;
}
.region-panel-head h3 {
  margin: 0;
  font-size: 16px;
}
.region-panel-head .muted {
  margin: 2px 0 0;
  font-size: 12px;
}
.region-panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.region-panel-title-row > div {
  min-width: 0;
}

.route-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid #465fff;
  border-radius: 10px;
  background: linear-gradient(135deg, #465fff 0%, #6b7cff 100%);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(70, 95, 255, 0.26);
}

.route-toggle:hover {
  border-color: #344bff;
  color: #ffffff;
  background: linear-gradient(135deg, #344bff 0%, #5f73ff 100%);
  box-shadow: 0 14px 28px rgba(70, 95, 255, 0.34);
}

.route-toggle.active {
  border-color: #344bff;
  background: linear-gradient(135deg, #344bff 0%, #465fff 100%);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(70, 95, 255, 0.36);
}

[data-theme="dark"] .route-toggle {
  border-color: rgba(129, 140, 248, 0.72);
  background: linear-gradient(135deg, #5b6cff 0%, #7c89ff 100%);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(91, 108, 255, 0.2);
}

[data-theme="dark"] .route-toggle:hover {
  border-color: #a5b4fc;
  color: #ffffff;
  background: linear-gradient(135deg, #6b7cff 0%, #91a0ff 100%);
}

[data-theme="dark"] .route-toggle.active {
  border-color: #a5b4fc;
  background: linear-gradient(135deg, #465fff 0%, #7c89ff 100%);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(129, 140, 248, 0.28);
}
.region-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px;
}
.region-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.region-summary-grid article {
  border: 1px solid #d7e4f3;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
}

[data-theme="dark"] .region-summary-grid article {
  border-color: #17304e;
  background: #0b1f36;
}
.region-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.region-summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}
.region-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.region-rank-row {
  display: grid;
  grid-template-columns: 26px 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid #d7e4f3;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}
.region-rank-row:hover,
.region-rank-row.active {
  border-color: #2563eb;
  background: #eff6ff;
}

[data-theme="dark"] .region-rank-row {
  border-color: #17304e;
  background: #0b1f36;
}

[data-theme="dark"] .region-rank-row:hover,
[data-theme="dark"] .region-rank-row.active {
  border-color: #60a5fa;
  background: #102a4a;
}
.region-rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #edf5ff;
  color: #58708d;
  border: 1px solid #d7e4f3;
  font-size: 12px;
  font-weight: 900;
}

[data-theme="dark"] .region-rank {
  background: #06111f;
  color: #8fb0d4;
  border-color: #17304e;
}
.region-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.region-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.region-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.region-name-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.region-row-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
}
.region-base-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 20px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 900;
}

[data-theme="dark"] .region-base-badge {
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}
.region-row-head em {
  color: var(--text);
  font-size: 17px;
  font-style: normal;
  font-weight: 950;
}
.region-row-sub {
  font-size: 11px;
  color: var(--muted);
}
.region-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #e2ebf6;
  overflow: hidden;
}

[data-theme="dark"] .region-bar {
  background: #13283f;
}
.region-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.region-customer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.region-customer.region-customer-recent {
  background: #fef9c3;
  border-radius: 8px;
  border-bottom-color: transparent;
  margin-bottom: 2px;
}

[data-theme="dark"] .region-customer.region-customer-recent {
  background: rgba(250, 204, 21, 0.14);
}
.region-customer:last-child {
  border-bottom: 0;
}
.region-customer:hover .rc-main strong {
  color: var(--blue-info);
}
.rc-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.rc-main strong {
  font-size: 14px;
}
.rc-main .muted {
  font-size: 12px;
}

.rc-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 92px;
  flex-shrink: 0;
}

.rc-visit-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
}

.rc-visit-date {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}

.rc-aside .tier-pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-toolbar {
  position: absolute;
  z-index: 450;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

[data-theme="dark"] .map-toolbar {
  background: transparent;
}

.map-hint {
  display: inline-flex;
  align-items: center;
  max-width: min(720px, 100%);
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(142, 162, 188, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  box-shadow: 0 10px 24px rgba(28, 51, 90, 0.12);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-hint:empty {
  display: none;
}

[data-theme="dark"] .map-hint {
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(7, 21, 38, 0.8);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
}

.page-panel {
  min-height: calc(100vh - 138px);
}

.map-section.page-panel {
  flex: 1;
  height: auto;
  min-height: 0;
  margin-bottom: 0;
}

.table-section.page-panel,
.visit-plan-section.page-panel {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head.compact {
  padding: 0 0 12px;
  border-bottom: 0;
}

#map {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #e7effa;
}

.leaflet-container {
  font: inherit;
  background: #e7effa;
}

[data-theme="dark"] #map,
[data-theme="dark"] .leaflet-container {
  background: #06111f;
}

.leaflet-tooltip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.leaflet-tooltip-top::before,
.leaflet-tooltip-bottom::before,
.leaflet-tooltip-left::before,
.leaflet-tooltip-right::before {
  border-top-color: var(--panel);
  border-bottom-color: var(--panel);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  color: var(--text);
}

.leaflet-control-zoom {
  border: 1px solid rgba(120, 146, 176, 0.45) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 26px rgba(28, 51, 90, 0.18);
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  line-height: 30px !important;
  border-bottom-color: rgba(120, 146, 176, 0.3) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #17345d !important;
}

.leaflet-control-zoom a:hover {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

[data-theme="dark"] .leaflet-control-zoom {
  border-color: rgba(96, 165, 250, 0.26) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
}

[data-theme="dark"] .leaflet-control-zoom a {
  border-bottom-color: rgba(96, 165, 250, 0.22) !important;
  background: rgba(10, 27, 48, 0.94) !important;
  color: #bfdbfe !important;
}

[data-theme="dark"] .leaflet-control-zoom a:hover {
  background: #102a4a !important;
  color: #ffffff !important;
}

.city-marker {
  background: transparent;
}

.province-marker {
  background: transparent;
  border: 0;
}

.base-marker {
  background: transparent;
  border: 0;
}

.base-halo {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28) 0 12%, rgba(37, 99, 235, 0.14) 13% 34%, rgba(37, 99, 235, 0.03) 35% 70%, transparent 71%);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
  opacity: 0.8;
  pointer-events: none;
  animation: base-ring 3.2s ease-in-out infinite;
}

.base-halo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
}

[data-theme="dark"] .base-halo {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.36) 0 12%, rgba(96, 165, 250, 0.2) 13% 34%, rgba(96, 165, 250, 0.05) 35% 70%, transparent 71%);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.24);
}

[data-theme="dark"] .base-halo::after {
  background: #60a5fa;
  box-shadow: 0 0 0 3px rgba(7, 21, 38, 0.88);
}

@keyframes base-ring {
  0%, 100% { transform: scale(0.92); opacity: 0.52; }
  50% { transform: scale(1.04); opacity: 0.82; }
}

.province-marker button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 52px;
  max-width: 78px;
  min-height: 30px;
  border: 1px solid rgba(29, 78, 216, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f2447;
  box-shadow: 0 8px 18px rgba(28, 51, 90, 0.14);
  padding: 4px 8px 5px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.province-marker button.has-visit-stat {
  padding-bottom: 4px;
}

.province-marker-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.province-marker.has-base button {
  max-width: 84px;
}

.province-marker .base-home {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(185, 28, 28, 0.28);
}

.province-marker .base-home svg {
  width: 13px;
  height: 13px;
  display: block;
}

.province-marker .base-home path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.province-marker-name {
  flex-shrink: 1;
  min-width: 0;
  max-width: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
}

.province-marker strong {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
}

.province-marker .visit-stat {
  display: block;
  width: 100%;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

[data-theme="dark"] .province-marker .visit-stat {
  color: #94a3b8;
}

.visit-pill {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.visit-pill-never {
  background: var(--surface-3);
  color: var(--muted);
}

.visit-pill-recent {
  background: #ffedd5;
  color: #c2410c;
}

.visit-pill-due {
  background: #dcfce7;
  color: #15803d;
}

.visit-pill-cooldown {
  background: #ffedd5;
  color: #c2410c;
}

.visit-pill-ready {
  background: #dcfce7;
  color: #15803d;
}

[data-theme="dark"] .visit-pill-recent,
[data-theme="dark"] .visit-pill-cooldown {
  background: rgba(251, 146, 60, 0.18);
  color: #fdba74;
}

[data-theme="dark"] .visit-pill-due,
[data-theme="dark"] .visit-pill-ready {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

.import-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.import-msg-error {
  color: #dc2626;
}

.import-msg-warn {
  color: #d97706;
}

.import-msg-muted {
  color: var(--muted);
}

.import-row-update {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
}

.import-row-skip_existing {
  opacity: 0.72;
}

.region-customer .visit-pill,
.region-customer .tier-pill {
  flex-shrink: 0;
}

.region-customer .visit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  text-align: center;
}

.province-marker.active button {
  border-color: #1d4ed8;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2), 0 14px 34px rgba(28, 51, 90, 0.24);
}

.province-marker.active strong {
  background: #1d4ed8;
}

[data-theme="dark"] .province-marker button {
  border-color: rgba(96, 165, 250, 0.3);
  background: rgba(239, 246, 255, 0.96);
  color: #082044;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.56);
}

[data-theme="dark"] .province-marker strong {
  background: #2563eb;
  color: #f8fffd;
}

[data-theme="dark"] .province-marker .base-home {
  border-color: rgba(255, 255, 255, 0.72);
  background: linear-gradient(145deg, #f87171, #dc2626);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(248, 113, 113, 0.28);
}

[data-theme="dark"] .province-marker.active button {
  border-color: #60a5fa;
  background: #eff6ff;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.26), 0 14px 34px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .province-marker.active strong {
  background: #1d4ed8;
}

.map-section.route-mode .region-panel {
  background: #f8fbff;
}

[data-theme="dark"] .map-section.route-mode .region-panel {
  background: #071526;
}

.route-base-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.route-base-card:hover {
  border-color: #465fff;
}

.route-base-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fee4e2;
  color: #d92d20;
  font-size: 18px;
  font-weight: 900;
}

.route-base-card strong {
  font-size: 15px;
  font-weight: 850;
  line-height: 1.3;
}

.route-base-card.missing {
  border-color: var(--line);
  background: var(--surface-2);
}

.route-base-card.missing .route-base-icon {
  background: var(--surface);
  color: var(--muted);
}

.route-panel-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.route-panel-summary article {
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.route-panel-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.route-panel-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 24px;
  line-height: 1;
}

.route-panel-timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.route-plan-stop {
  display: grid;
  gap: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.route-plan-stop:hover {
  border-color: #465fff;
  background: #f5f8ff;
}

.route-stop-top {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.route-stop-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eff4ff;
  color: #465fff;
  font-size: 13px;
  font-weight: 850;
}

.route-stop-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.route-stop-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 850;
}

.route-stop-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-mode-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  border-radius: 999px;
  background: #eff4ff;
  color: #465fff;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 850;
}

.route-mode-pill b,
.route-mode-stat b,
.route-path-leg b,
.transport-label b,
.route-stop em b,
.rs-mode b {
  display: inline-block;
  min-width: 12px;
  color: currentColor;
  font-size: 12px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
}

.route-mode-pill b:empty,
.route-mode-stat b:empty,
.route-path-leg b:empty,
.transport-label b:empty,
.route-stop em b:empty,
.rs-mode b:empty {
  display: none;
}

.route-path-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.route-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-path-head strong {
  font-size: 13px;
  font-weight: 900;
}

.route-path-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.route-path-track {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.route-path-node,
.route-path-leg,
.route-mode-stat {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  white-space: nowrap;
}

.route-path-node {
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 850;
}

.route-path-node.base {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.route-path-leg {
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.route-path-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.route-mode-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 12px;
}

.route-mode-stat {
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.route-mode-stat em {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.route-mode-rail {
  background: var(--green-soft);
  color: var(--green);
}

.route-mode-plane {
  background: #dbeafe;
  color: var(--blue-info);
}

.route-mode-drive,
.route-mode-taxi {
  background: var(--amber-soft);
  color: var(--amber);
}

.route-mode-walk,
.route-mode-other,
.route-mode-default {
  background: var(--surface-2);
  color: var(--muted);
}

.route-stop-customers {
  display: grid;
  gap: 4px;
  padding-top: 9px;
  border-top: 1px solid #eef2f6;
}

.route-plan-customer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
}

.route-plan-customer::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #98a2b3;
}

.route-plan-customer:hover {
  color: #465fff;
}

.route-plan-customer strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.route-plan-customer span {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.route-stop-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.route-stop-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.route-panel-empty {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 16px;
}

.route-panel-empty strong {
  font-size: 15px;
}

.route-panel-empty span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

[data-theme="dark"] .route-base-card {
  border-color: #17304e;
  background: #0b1f36;
}

[data-theme="dark"] .route-base-card:hover {
  border-color: #60a5fa;
}

[data-theme="dark"] .route-base-icon {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
}

[data-theme="dark"] .route-panel-summary article,
[data-theme="dark"] .route-path-card,
[data-theme="dark"] .route-mode-stat,
[data-theme="dark"] .route-plan-stop {
  border-color: #17304e;
  background: #0b1f36;
}

[data-theme="dark"] .route-path-node,
[data-theme="dark"] .route-stop-meta span {
  border-color: #17304e;
  background: #071526;
}

[data-theme="dark"] .route-path-node.base {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

[data-theme="dark"] .route-mode-stat em {
  background: #071526;
  color: #e5eefb;
}

[data-theme="dark"] .route-plan-stop:hover {
  border-color: #60a5fa;
  background: #102a4a;
}

[data-theme="dark"] .route-stop-index,
[data-theme="dark"] .route-mode-pill {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

[data-theme="dark"] .route-stop-customers {
  border-top-color: #17304e;
}

[data-theme="dark"] .route-plan-customer:hover {
  color: #93c5fd;
}

.route-stop,
.traveler-marker {
  background: transparent;
}

.route-stop button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(20, 24, 33, 0.2);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.route-stop span,
.route-stop strong {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
}

.route-stop span {
  background: var(--blue);
  color: var(--panel);
}

.route-stop strong {
  background: var(--green-soft);
  color: var(--green);
}

.route-stop em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 0 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.route-stop.today button {
  border-color: var(--red);
  background: var(--amber-soft);
  color: var(--red);
}

.transport-label {
  background: transparent;
}

.transport-label span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  box-shadow: 0 8px 20px rgba(20, 24, 33, 0.16);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.transport-plane span {
  border-color: var(--line-strong);
  color: var(--blue-info);
}

.transport-rail span {
  border-color: var(--line-strong);
  color: var(--green);
}

.transport-drive span,
.transport-taxi span {
  border-color: var(--line-strong);
  color: var(--amber);
}

.transport-walk span {
  border-color: var(--line-strong);
  color: var(--muted);
}

.transport-other span {
  border-color: var(--line-strong);
  color: var(--purple);
}

.route-path-node.depart {
  border-color: #f59e0b;
  color: #b45309;
  background: #fffbeb;
}

.route-origin button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fffbeb;
  color: #b45309;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.18);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.route-origin.base button {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
}

.route-origin span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  font-size: 11px;
}

.traveler-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: visible;
}

.traveler-pulse {
  position: absolute;
  inset: 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  animation: traveler-pulse 1.8s ease-out infinite;
}

@keyframes traveler-pulse {
  0% { transform: scale(0.72); opacity: 0.72; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

.traveler-mode-tag {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 34px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
}

.traveler-plane-icon {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  transform: rotate(var(--traveler-angle, 0deg));
  transform-origin: 50% 50%;
}

.traveler-plane-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 58%, 62% 58%, 62% 100%, 38% 100%, 38% 58%, 0% 58%);
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
}

.traveler-walk-icon {
  display: block;
  width: 18px;
  height: 28px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #64748b 0%, #334155 100%);
  transform: rotate(var(--traveler-angle, 0deg));
  transform-origin: 50% 80%;
  box-shadow: 0 10px 16px rgba(15, 23, 42, 0.18);
}

.traveler-shell img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(20, 24, 33, 0.22));
  pointer-events: none;
  transform: rotate(var(--traveler-angle, 0deg));
  transform-origin: 50% 50%;
}

.traveler-rail .traveler-shell img {
  width: 68px;
  height: 32px;
}

.traveler-rail-car {
  position: relative;
  display: block;
  width: 48px;
  height: 18px;
  border-radius: 999px 12px 12px 999px;
  background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 34%, #10b981 35%, #047857 100%);
  border: 2px solid #047857;
  box-shadow: 0 10px 18px rgba(4, 120, 87, 0.22);
  transform: rotate(var(--traveler-angle, 0deg));
  transform-origin: 50% 50%;
}

.traveler-rail-car::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 19px;
  height: 7px;
  border-radius: 999px;
  background: #93c5fd;
  box-shadow: 23px 0 0 rgba(255, 255, 255, 0.82);
}

.traveler-rail-car::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #047857;
  transform: translateY(-50%) rotate(45deg);
}

.traveler-road-car {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px 14px 14px 12px;
  background: linear-gradient(90deg, #fff7ed 0%, #f97316 46%, #b45309 100%);
  border: 2px solid #92400e;
  box-shadow: 0 12px 18px rgba(20, 24, 33, 0.22);
  transform: rotate(var(--traveler-angle, 0deg));
  transform-origin: 50% 50%;
}

.traveler-road-car::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  width: 17px;
  height: 8px;
  border-radius: 999px 999px 4px 4px;
  background: #bfdbfe;
  box-shadow: 12px 0 0 rgba(255, 255, 255, 0.7);
}

.traveler-road-car::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -5px;
  height: 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 4px 4px, #111827 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 4px) 4px, #111827 0 3px, transparent 3.5px);
}

.traveler-shell b {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--text);
  color: var(--panel);
  padding: 0 7px;
  box-shadow: 0 8px 16px rgba(20, 24, 33, 0.22);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.traveler-plane .traveler-shell b {
  background: var(--blue-info);
}

.traveler-rail .traveler-shell b {
  background: var(--green);
}

.traveler-drive .traveler-shell b,
.traveler-taxi .traveler-shell b {
  background: var(--amber);
}

.traveler-walk .traveler-shell b,
.traveler-other .traveler-shell b,
.traveler-default .traveler-shell b {
  background: var(--muted);
}

#boardPage .section-head {
  flex-shrink: 0;
}

#resultCount {
  margin-top: 4px;
  line-height: 1.35;
}

.board-filters {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 128px 128px auto;
  align-items: center;
  gap: 10px;
}

.board-filters input,
.board-filters select {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  box-sizing: border-box;
  margin: 0;
}

.board-filters .quick-filters {
  justify-self: end;
  flex-wrap: nowrap;
}

.board-filters .quick-filters button {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  line-height: 36px;
}

.board-actions {
  align-items: center;
}

.board-actions .primary,
.board-actions .secondary {
  min-height: 36px;
  height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.board-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable;
}

.board-table {
  table-layout: fixed;
  min-width: 960px;
}

.board-table th,
.board-table td {
  vertical-align: middle;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-table th {
  padding: 10px 12px;
}

.board-table td {
  padding: 10px 12px;
}

.board-table .board-col-name { width: 16%; min-width: 120px; }
.board-table .board-col-mono { width: 14%; min-width: 108px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.board-table .board-col-phone { width: 11%; min-width: 96px; }
.board-table .board-col-region { width: 12%; min-width: 88px; }
.board-table .board-col-version { width: 8%; min-width: 72px; }
.board-table .board-col-date { width: 14%; min-width: 120px; white-space: normal; }
.board-table .board-col-tier { width: 9%; min-width: 96px; }

.board-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.board-table .tier-select {
  display: block;
  width: 100%;
  max-width: 108px;
  min-height: 30px;
  padding: 4px 10px;
  box-sizing: border-box;
  line-height: 1.2;
}

.board-table-wrap .empty {
  position: sticky;
  left: 0;
}

.table-wrap {
  width: 100%;
  max-height: calc(100vh - 252px);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
  background: var(--surface-3);
  box-shadow: inset 0 -1px 0 var(--line);
}

th[data-sort] {
  cursor: pointer;
}

th[data-sort]::after {
  content: "";
  display: inline-block;
  margin-left: 5px;
  color: var(--muted-2);
  font-size: 10px;
}

th[data-sort]:hover {
  color: var(--text);
}

th.sort-active {
  color: var(--blue);
  background: var(--blue-soft);
}

th.sort-active[data-dir="asc"]::after {
  content: "▲";
}

th.sort-active[data-dir="desc"]::after {
  content: "▼";
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: var(--surface-2);
}

.priority-row.high td:first-child {
  box-shadow: inset 4px 0 0 var(--red);
}

.priority-row.medium td:first-child {
  box-shadow: inset 4px 0 0 var(--amber);
}

.priority-row.normal td:first-child {
  box-shadow: inset 4px 0 0 var(--muted-2);
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.priority-pill.high {
  background: var(--red-soft);
  color: var(--red);
}

.priority-pill.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.priority-pill.normal {
  background: var(--surface-3);
  color: var(--muted);
}

/* 客户分层 tier：优质金 / 成长型蓝 / 淘汰灰 */
.tier-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
}
.tier-pill.tier-gold { background: #fef3c7; color: #92400e; }
.tier-pill.tier-blue { background: #dbeafe; color: #1d4ed8; }
.tier-pill.tier-gray { background: #eef0f3; color: #475467; }
.tier-pill.tier-none { background: var(--surface-3); color: var(--muted); }

.tier-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tier-select.tier-gold { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.tier-select.tier-blue { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.tier-select.tier-gray { background: #eef0f3; color: #475467; border-color: #d0d5dd; }
.tier-select.tier-none { background: var(--surface-3); color: var(--muted); border-color: var(--line-strong); }

[data-theme="dark"] .tier-pill.tier-gold,
[data-theme="dark"] .tier-select.tier-gold { background: #3a2f0a; color: #fbbf24; border-color: #5a4410; }
[data-theme="dark"] .tier-pill.tier-blue,
[data-theme="dark"] .tier-select.tier-blue { background: #0f1f3d; color: #60a5fa; border-color: #1e3a5f; }
[data-theme="dark"] .tier-pill.tier-gray,
[data-theme="dark"] .tier-select.tier-gray { background: #23262d; color: #98a2b3; border-color: #2e333b; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.danger {
  background: var(--red-soft);
  color: var(--red);
}

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

.dialog {
  width: min(560px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
}

.dialog::backdrop {
  background: rgba(20, 24, 33, 0.36);
}

.dialog.wide {
  width: min(960px, calc(100vw - 24px));
}

.dialog.invite-dialog {
  width: min(1120px, calc(100vw - 24px));
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog > .stack,
.customer-form {
  padding: 16px;
}

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

.customer-form .full,
.dialog-actions.full {
  grid-column: 1 / -1;
}

.form-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.customer-basic-grid,
.customer-extra-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.customer-basic-grid .full,
.customer-extra-grid .full {
  grid-column: 1 / -1;
}

.customer-extra {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 0 14px 14px;
}

.customer-extra summary {
  cursor: pointer;
  font-weight: 800;
  padding: 14px 0;
  list-style: none;
}

.customer-extra summary::-webkit-details-marker {
  display: none;
}

.customer-extra[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.last-visit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.last-visit-row input[type="date"] {
  flex: 1;
  min-width: 0;
}

button.tiny {
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.customer-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.summary-main {
  min-width: 0;
}

.summary-visit-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  text-align: right;
}

.summary-visit-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-visit-days {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
  color: var(--text);
}

.summary-visit-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.customer-summary h3 {
  margin: 8px 0 4px;
  font-size: 20px;
}

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

.summary-grid article {
  display: grid;
  gap: 6px;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-grid strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.dialog-actions {
  justify-content: flex-end;
}

.grow {
  flex: 1;
}

.preview-wrap {
  max-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.visit-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-2);
}

.visit-plan-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#visitsPage .section-head {
  flex-shrink: 0;
}

.visit-list-panel {
  min-width: 0;
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.visit-plan-rows {
  display: grid;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#visitsPage.is-archive-view .visit-plan-layout {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
}

#visitsPage.is-archive-view .visit-focus {
  border-right: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 20px;
  align-items: center;
  padding: 12px 16px;
}

#visitsPage.is-archive-view .visit-focus h3 {
  margin: 0;
  white-space: nowrap;
}

#visitsPage.is-archive-view .visit-focus p {
  display: none;
}

#visitsPage.is-archive-view .visit-stats {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  margin-top: 0;
  margin-left: auto;
  width: min(100%, 360px);
}

#visitsPage.is-archive-view .visit-list-panel {
  padding: 12px 16px 16px;
}

#visitsPage.is-archive-view .visit-archive-toggle {
  flex-shrink: 0;
  margin-bottom: 10px;
}

#visitsPage.is-archive-view .archive-calendar-shell {
  margin-top: 0;
  min-height: 520px;
  height: 100%;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
}

#visitsPage.is-archive-view .archive-calendar-shell #archiveCalendar {
  flex: 1;
  min-height: 460px;
}

.visit-focus {
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  padding: 18px;
}

.visit-focus p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.visit-stats {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.visit-stats article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.visit-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.visit-stats strong {
  font-size: 24px;
  line-height: 1;
}

.visit-plan-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  box-shadow: 0 6px 18px rgba(20, 24, 33, 0.05);
}

.visit-plan-card.pending {
  border-left: 4px solid var(--blue);
}

.visit-plan-card.done {
  border-left: 4px solid var(--green);
}

.visit-plan-card.changed {
  border-left: 4px solid var(--amber);
}

.visit-plan-card.cancelled {
  opacity: 0.68;
}

.visit-date {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-3);
  padding: 10px 6px;
}

.visit-date strong {
  font-size: 20px;
}

.visit-date span,
.visit-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.visit-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.visit-main p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.visit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.visit-actions {
  display: flex;
  gap: 8px;
}

.visit-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.status-pill.pending {
  color: var(--blue);
}

.status-pill.done {
  color: var(--green);
}

.status-pill.changed {
  color: var(--amber);
}

.status-pill.cancelled {
  color: var(--muted);
}

.visit-plan-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.visit-plan-form .full,
.visit-plan-form .wide-field {
  grid-column: span 2;
}

.visit-plan-form .full,
.visit-plan-form .dialog-actions.full {
  grid-column: 1 / -1;
}

.visit-list {
  display: grid;
  gap: 8px;
}

.visit-item {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.visit-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.visit-item strong {
  display: block;
  font-size: 13px;
}

.visit-item p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--text);
  color: var(--panel);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 5000;
}

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    padding: 12px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: flex;
  }

  .board-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .board-filters {
    grid-template-columns: 1fr;
  }

  .board-filters .quick-filters {
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .region-panel {
    display: none;
  }
  .map-section {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .map-stage {
    grid-column: 1;
  }
  #map {
    height: calc(100vh - 218px);
    min-height: 520px;
  }

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

  .customer-basic-grid,
  .customer-extra-grid {
    grid-template-columns: 1fr;
  }

  .customer-summary,
  .summary-grid,
  .visit-plan-layout,
  .visit-plan-form {
    grid-template-columns: 1fr;
  }

  #visitsPage.is-archive-view .visit-focus {
    grid-template-columns: 1fr;
  }

  #visitsPage.is-archive-view .visit-stats {
    margin-left: 0;
    width: 100%;
    max-width: none;
  }

  #visitsPage.is-archive-view .archive-calendar-shell {
    min-height: 420px;
  }

  #visitsPage.is-archive-view .archive-calendar-shell #archiveCalendar {
    min-height: 360px;
  }

  .visit-focus {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .visit-plan-card {
    grid-template-columns: 1fr;
  }

  .archive-date-card {
    grid-template-columns: 1fr;
  }

  .visit-actions {
    justify-content: flex-end;
  }

  .visit-plan-form .full,
  .visit-plan-form .wide-field {
    grid-column: 1 / -1;
  }

  .summary-grid article {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 24px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  #map {
    height: calc(100vh - 250px);
    min-height: 430px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}

/* === 看板重点列 === */
.col-revenue {
  font-weight: 800;
  color: var(--text);
}

.col-next {
  white-space: normal;
  max-width: 220px;
  color: var(--text-2);
}

td.col-next:empty::before {
  content: "-";
  color: var(--muted);
}

/* === 本周路线摘要条 === */
.route-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-2));
  padding: 11px 14px;
  overflow-x: auto;
}

.visit-archive-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.visit-archive-toggle button {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.visit-archive-toggle button.active {
  background: var(--text);
  color: var(--surface-2);
  border-color: var(--text);
}
.empty-inline {
  padding: 18px 4px;
  color: var(--muted);
  font-size: 14px;
}

.invite-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

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

.invite-stat-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.invite-stat-card:hover {
  border-color: var(--line-strong);
}

.invite-stat-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.invite-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.invite-summary-grid strong {
  font-size: 24px;
  line-height: 1;
}

.invite-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 130px 150px auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

@media (max-width: 720px) {
  .invite-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invite-filter-bar {
    grid-template-columns: 1fr;
  }

  .invite-filter-bar button {
    width: 100%;
  }
}

.import-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.invite-table-wrap {
  max-height: min(560px, calc(100vh - 342px));
}
.invite-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--blue);
}
.invite-status {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text-2);
}

.mini-action {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.archive-calendar-shell {
  margin-top: 0;
  padding: 16px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.archive-calendar-shell .fc {
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.archive-calendar-shell .fc .fc-toolbar {
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-calendar-shell .fc .fc-toolbar-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0;
  padding: 0 8px;
}

.archive-calendar-shell .fc .fc-button {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
}

.archive-calendar-shell .fc .fc-button:hover,
.archive-calendar-shell .fc .fc-button:focus {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(70, 96, 255, 0.26);
}

.archive-calendar-shell .fc .fc-button:focus {
  box-shadow: 0 0 0 3px rgba(70, 96, 255, 0.14);
}

.archive-calendar-shell .fc-theme-standard .fc-scrollgrid,
.archive-calendar-shell .fc-theme-standard td,
.archive-calendar-shell .fc-theme-standard th {
  border-color: var(--line);
}

.archive-calendar-shell .fc-theme-standard .fc-scrollgrid {
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.archive-calendar-shell .fc .fc-col-header-cell {
  padding: 10px 0;
  background: var(--surface-3);
}

.archive-calendar-shell .fc .fc-col-header-cell-cushion {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  padding: 2px 4px;
}

.archive-calendar-shell .fc .fc-daygrid-day {
  background: var(--panel);
  cursor: pointer;
  transition: background 0.15s ease;
}

.archive-calendar-shell .fc .fc-daygrid-day:hover {
  background: rgba(70, 96, 255, 0.05);
}

.archive-calendar-shell .fc .fc-daygrid-day-frame {
  min-height: 104px;
  padding: 6px;
}

.archive-calendar-shell .fc .fc-daygrid-day.fc-day-other {
  background: var(--surface-2);
}

.archive-calendar-shell .fc .fc-daygrid-day-number {
  min-width: 22px;
  height: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.archive-calendar-shell .fc .fc-day-today {
  background: rgba(70, 96, 255, 0.06);
}

.archive-calendar-shell .fc .fc-day-today .fc-daygrid-day-number {
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
}

.archive-calendar-shell .fc .fc-daygrid-event {
  margin-top: 3px;
  border: 0;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  cursor: pointer;
}

.archive-calendar-shell .fc .fc-daygrid-event:hover {
  background: rgba(70, 96, 255, 0.16);
}

.archive-calendar-shell .fc .fc-event-main {
  color: inherit;
}

.archive-calendar-shell .fc .fc-event-main-frame {
  min-width: 0;
}

.archive-calendar-shell .fc .fc-plan-event {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  line-height: 1.35;
  font-size: 12px;
}

.fc-plan-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex: none;
  background: currentColor;
}

.fc-plan-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-calendar-shell .fc .fc-daygrid-more-link {
  color: var(--blue);
  font-weight: 800;
}

.archive-date-dialog {
  padding: 18px 20px 20px;
}

.archive-date-rows {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.archive-date-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.archive-date-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.archive-date-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-date-main span,
.archive-transport-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-transport-field {
  display: grid;
  gap: 5px;
}

.archive-transport-field select {
  min-height: 34px;
}

.archive-date-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.calendar-panel {
  margin-top: 0;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.cal-head strong {
  font-size: 16px;
  min-width: 120px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.cal-dow {
  background: var(--surface-3);
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.cal-cell {
  background: var(--panel);
  min-height: 92px;
  padding: 6px 7px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cal-cell:not(.blank):hover {
  background: rgba(70, 96, 255, 0.06);
}
.cal-cell.blank {
  background: var(--surface-2);
  cursor: default;
}
.cal-day {
  color: var(--muted);
  font-weight: 700;
}
.cal-cell.today .cal-day {
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
}
.cal-cell.has {
  background: var(--surface-2);
}
.cal-items {
  margin-top: 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-item {
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-empty {
  text-align: center;
  padding: 24px;
}

.version-memo-dialog {
  padding: 20px 22px 22px;
}

.version-btn {
  margin-top: auto;
  margin-left: 8px;
  margin-right: 8px;
  margin-bottom: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 16px);
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.version-btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px rgba(20, 24, 33, 0.12);
}
.vb-ico {
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}
.vb-text { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12px; }
.vb-badge {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 999px;
  padding: 2px 6px;
  position: relative;
  flex: none;
}
.vb-arrow {
  color: var(--muted);
  font-size: 16px;
  transition: transform 180ms ease, color 180ms ease;
}
.version-btn:hover .vb-arrow {
  transform: translateX(3px);
  color: var(--text);
}

.onboard-form .full {
  grid-column: 1 / -1;
}
.vm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.vm-version {
  font-size: 12px;
  font-weight: 800;
  color: var(--surface-2);
  background: var(--text);
  border-radius: 999px;
  padding: 2px 10px;
}
.vm-date {
  font-size: 12px;
  color: var(--muted);
}
.vm-tenet {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text-2);
}
.vm-note {
  margin: -4px 0 16px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.65;
}
.vm-list {
  margin: 0 0 16px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: disc;
}
.vm-list li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
}
.vm-foot {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
}
.vm-log {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.vm-log-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}
.vm-log-item {
  margin: 0 0 7px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.vm-log-item strong {
  color: var(--text);
}

.route-summary .rs-label {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.route-summary .rs-track {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.rs-stop {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.rs-mode {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.rs-plane { color: var(--blue-info); }
.rs-rail { color: var(--green); }
.rs-drive,
.rs-taxi { color: var(--amber); }
.rs-walk { color: var(--muted); }
.rs-other { color: var(--purple); }

/* === 拜访计划时间分组 === */
.visit-group {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.visit-group:last-child {
  margin-bottom: 0;
}

.visit-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.visit-group-head::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 999px;
  background: var(--blue);
}

.visit-group-head.today::before { background: var(--red); }
.visit-group-head.soon::before { background: var(--amber); }
.visit-group-head.week::before { background: var(--blue); }
.visit-group-head.later::before { background: var(--muted-2); }
.visit-group-head.past::before { background: var(--muted-2); }

.visit-group-head em {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.visit-group-head.today {
  color: var(--red);
}

.visit-group-head.today em {
  background: var(--red-soft);
  color: var(--red);
}

.next-step {
  color: var(--text) !important;
  font-weight: 800;
}

.visit-group:has(.visit-group-head.past) .visit-plan-card {
  opacity: 0.7;
}

/* === 首次引导 === */
.dialog.onboard {
  width: min(540px, calc(100vw - 24px));
  padding: 24px 24px 22px;
  border-radius: 16px;
}

.onboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.onboard-steps {
  display: flex;
  gap: 6px;
}

.onboard-steps .dot {
  width: 22px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 200ms ease;
}

.onboard-steps .dot.active {
  background: var(--blue);
}

.onboard-step h2 {
  font-size: 21px;
}

.onboard-lead {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.onboard-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.onboard-tip {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.onboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.onboard-preview {
  max-height: 210px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.onboard-preview table {
  min-width: 0;
}
