﻿:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-hover: #fafbfc;
  --panel-strong: #ffffff;
  --panel-soft: #f8f9fa;
  --line: #e5e6eb;
  --line-strong: #dee0e3;
  --border: #dee0e3;
  --bg-deep: #ebedf0;
  --text: #1f2329;
  --muted: #8f959e;
  --navy: #1b2a3d;
  --navy-soft: #243548;
  --teal: #0f766e;
  --teal-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --rose: #dc2626;
  --rose-soft: #fee2e2;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.05);
  --radius-xl: 12px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

html {
  overscroll-behavior-y: auto;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  overscroll-behavior-y: auto;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  padding-bottom: 108px;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 24px 68px;
  gap: 24px;
  align-items: start;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  color: #f5efe4;
  background: #1b2a3d;
  border-radius: 0;
  box-shadow: none;
  border-right: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 16px 18px 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: none;
}

.brand h1,
.topbar h2,
.hero-copy h3,
.panel-head h3,
.park-card h2 {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

.brand h1 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.park-card,
.sidebar-foot {
  padding: 18px 18px 19px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.side-link {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-weight: 500;
  font-size: 13px;
}

.side-link::before {
  display: none;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-link.active {
  background: #2d4159;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #4db8ac;
  transform: none;
  border-color: transparent;
}

.side-link.active::before {
  display: none;
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  touch-action: pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.topbar,
.hero-panel,
.panel,
.analytics-card,
.table-card,
.ana-panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: none;
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius-lg);
}

.topbar::before,
.topbar::after,
.panel::before,
.ana-panel::before,
.hero-panel::before {
  display: none;
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 18px;
}

.topbar-copy,
.topbar-actions {
  position: relative;
  z-index: 1;
}

.topbar-copy {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topbar-copy .eyebrow {
  color: var(--amber);
}

.topbar h2 {
  font-size: clamp(20px, 2.6vw, 25px);
  line-height: 1.15;
}

.topbar-desc {
  max-width: 720px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.topbar-actions {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  display: flex;
  gap: 10px;
}

.topbar-actions:empty {
  display: none;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(27,42,61,0.18);
  z-index: 90;
  transition: opacity .15s;
}

.menu-toggle:active {
  opacity: .7;
}

.menu-toggle svg {
  display: block;
}

.ghost-btn,
.solid-btn,
.tab-btn,
.mini-action,
.ef-btn {
  font-weight: 600;
}

.ghost-btn,
.solid-btn,
.tab-btn {
  padding: 11px 18px;
  border: 1px solid transparent;
  box-shadow: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ghost-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-btn:hover {
  background: var(--panel-hover);
  border-color: var(--line-strong);
}

.solid-btn,
.tab-btn.active {
  background: #0f766e;
  color: white;
  box-shadow: none;
  border: 1px solid #0f766e;
}

.solid-btn:hover,
.tab-btn.active:hover {
  background: #0d5f59;
}

.mini-action {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.mini-action:hover {
  background: var(--panel-hover);
  border-color: var(--line-strong);
}

.hero-panel,
.panel,
.analytics-card,
.table-card,
.ana-panel {
  border-radius: var(--radius-lg);
}

.panel,
.ana-panel,
.analytics-card {
  padding: 20px;
}

.main-panel > .panel,
.main-panel > .viz-section {
  margin: 0 !important;
}

.summary-card,
.building-card,
.task-item,
.timeline-item,
.lease-card,
.opportunity-item,
.list-card,
.feature-card,
.module-card,
.progress-step,
.matrix-card,
.kanban-card,
.viz-section,
.bld-section,
.kpi-card,
.expiry-card {
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: #fff;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.kpi-card {
  position: relative;
  padding: 10px 14px;
  overflow: hidden;
  background: #fff;
  border-left: 3px solid var(--teal);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.kpi-card::after {
  display: none;
}

.kpi-card:nth-child(4n+2) {
  border-left-color: #3b82f6;
}

.kpi-card:nth-child(4n+2)::after {
  display: none;
}

.kpi-card:nth-child(4n+3) {
  border-left-color: var(--amber);
}

.kpi-card:nth-child(4n+3)::after {
  display: none;
}

.kpi-card:nth-child(4n+4) {
  border-left-color: var(--rose);
}

/* === Amount Privacy Mask === */
.kpi-card .kpi-amount-real { display: inline !important; opacity: 1 !important; font-size: inherit; color: inherit; }
.kpi-card .kpi-amount-mask { display: none !important; opacity: 1 !important; color: var(--muted); letter-spacing: 3px; font-size: inherit; }
.kpi-card.amounts-hidden .kpi-amount-real { display: none !important; }
.kpi-card.amounts-hidden .kpi-amount-mask { display: inline !important; }
.amount-privacy .amount-real { display: inline !important; }
.amount-privacy .amount-mask { display: none !important; color: var(--muted); letter-spacing: 2px; }
.amount-privacy.amounts-hidden .amount-real { display: none !important; }
.amount-privacy.amounts-hidden .amount-mask { display: inline !important; }
.kpi-eye-btn {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; cursor: pointer;
  padding: 2px 4px; font-size: 12px; color: var(--muted);
  z-index: 2; line-height: 1; opacity: 0.45;
  transition: opacity 0.15s;
}
.kpi-eye-btn:hover { opacity: 1; }
.amount-privacy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.amount-privacy-toggle svg {
  flex: 0 0 auto;
}

.kpi-card strong {
  position: relative;
  z-index: 1;
  font-size: clamp(20px, 2.5vw, 24px);
  color: var(--text);
}

.kpi-card span,
.summary-card span {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.18s;
}

.kpi-card:hover span,
.summary-card:hover span,
.kpi-card.show-note span {
  opacity: 1;
}

#financeMetrics .finance-kpi-card p,
#financeMetrics .finance-kpi-card span,
#financeMetrics .finance-kpi-card .amount-privacy,
#financeMetrics .finance-kpi-card .amount-real,
#financeMetrics .finance-kpi-card .amount-mask {
  opacity: 1 !important;
}

#financeMetrics .finance-kpi-card strong .amount-privacy {
  display: inline !important;
}

#financeMetrics .finance-kpi-card .finance-kpi-note {
  display: block;
  color: var(--muted);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-head h3,
.viz-section h3 {
  font-size: 18px;
  margin: 0;
}

.panel-note,
.viz-section .viz-desc {
  line-height: 1.6;
  color: var(--muted);
}

.module-card,
.feature-card,
.list-card,
.matrix-card {
  display: block;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.module-card:hover,
.feature-card:hover,
.building-card:hover,
.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: var(--panel-hover);
}

.module-card h4,
.feature-card h4,
.list-card h4,
.matrix-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}

.module-card p,
.feature-card p,
.list-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.module-card span {
  display: inline-flex;
  margin-top: 12px;
  color: var(--teal);
  font-weight: 700;
  font-size: 13px;
}

.feature-card {
  display: grid;
  gap: 10px;
}

.feature-card .badge-row {
  margin-top: 2px;
}

.building-card {
  padding: 16px 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.building-card header,
.lease-card header,
.opportunity-item header,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.building-card header {
  margin-bottom: 12px;
}

.building-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.building-meta div {
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-btn {
  background: #f8f9fa;
  color: var(--text);
  border: 1px solid var(--line);
}

.tab-btn.active {
  background: #0f766e;
  color: white;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.table-card {
  overflow: hidden;
  border-radius: 8px;
}

.table-scroller {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.table-scroller::-webkit-scrollbar,
.mobile-dock::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-scroller::-webkit-scrollbar-thumb,
.mobile-dock::-webkit-scrollbar-thumb {
  background: rgba(21, 36, 51, 0.18);
  border-radius: 999px;
}

.data-table,
.viz-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
}

.data-table thead,
.viz-table thead {
  background: #f8f9fa;
}

.data-table th,
.data-table td,
.viz-table th,
.viz-table td {
  white-space: normal;
  vertical-align: top;
  text-align: left;
  padding: 14px 16px;
}

.data-table th,
.viz-table th {
  font-size: 12px;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: var(--muted);
}

.data-table td,
.viz-table td {
  font-size: 13px;
  line-height: 1.55;
  border-bottom: 1px solid #f2f3f5;
}

.data-table tbody tr:hover {
  background: #f8fafb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status-pill.rented {
  background: var(--teal-soft);
  color: #0f6156;
}

.status-pill.vacant {
  background: var(--amber-soft);
  color: #8a5d15;
}

.status-pill.alert {
  background: var(--rose-soft);
  color: #9b4438;
}

.mini-action {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-link-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link-btn:hover {
  color: var(--teal);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.forecast-section {
  padding: 20px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.forecast-card {
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.forecast-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.forecast-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
  color: var(--text);
  font-weight: 700;
}

.forecast-card em {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}

.forecast-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.forecast-badge.positive {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
}

.forecast-badge.neutral {
  color: #64748b;
  background: rgba(148, 163, 184, 0.1);
}

.ai-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.ai-insight-card {
  padding: 18px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15,118,110,0.15);
}

.ai-insight-card .eyebrow,
.ai-insight-card p {
  color: var(--muted);
}

.ai-insight-card h4 {
  margin: 4px 0 10px;
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
}

.filter-row,
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8f9fa;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  border: 1px solid var(--line);
  cursor: pointer;
}

.filter-chip.active {
  background: #e6f7f5;
  color: #065f46;
  border-color: rgba(15,118,110,0.3);
  font-weight: 600;
}

.lease-cards,
.lease-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lease-card {
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.lease-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.lease-card h4 {
  margin: 0;
  font-size: 14px;
}

.lease-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.opportunity-item {
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.opportunity-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.opportunity-item h4 {
  margin: 0;
  font-size: 14px;
}

.opportunity-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.kanban,
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kanban-col {
  padding: 14px;
  border-radius: 8px;
  background: #f4f5f7;
  border: 1px solid var(--line);
}

.kanban-col h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.kanban-list {
  display: grid;
  gap: 10px;
}

.kanban-card {
  padding: 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.kanban-card p,
.timeline-item p,
.task-item p,
.opportunity-item p,
.lease-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
}

.analytics-card {
  padding: 20px;
  border-radius: 8px;
}

.split-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.progress-step {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.matrix-card {
  padding: 16px 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.matrix-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.section-stack {
  display: grid;
  gap: 20px;
}

.stack-bars,
.stack-list {
  display: grid;
  gap: 14px;
}

.stack-row {
  display: grid;
  gap: 8px;
}

.stack-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}

.stack-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.stack-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1b2a3d;
}

.occupancy-meter {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.occupancy-meter > span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.funnel-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.funnel-bar > span {
  display: block;
  height: 100%;
  background: var(--amber);
}

.stacked-bar-track {
  display: flex;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  background: #e5e7eb;
}

.stacked-bar-track > div {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 8px;
  font-weight: 600;
  min-width: 2px;
  transition: width .3s;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(21, 36, 51, 0.5);
  backdrop-filter: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  width: min(640px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--panel-strong);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
  transform: translateY(20px);
  transition: transform 0.2s ease;
  border: 1px solid var(--line);
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 0;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(21,36,51,0.08);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.modal-body {
  padding: 16px 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 20px;
}

/* ===== Form ===== */
.form-group {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
}

.form-group textarea {
  min-height: 60px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

/* ===== Filter Bar ===== */
.filter-select,
.filter-input {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font: inherit;
  font-size: 13px;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--teal);
}

.filter-input {
  min-width: 180px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: var(--teal);
}

.toast-error {
  background: var(--rose);
}

/* ===== Mini Danger Button ===== */
.mini-danger {
  color: var(--rose);
}

.mini-danger:hover {
  background: var(--rose-soft);
}

/* ===== 停车管理模块 ===== */
#parkingMetrics .kpi-card span {
  opacity: 1;
  max-height: 40px;
}

.parking-iframe-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  min-height: 500px;
}
.parking-iframe-wrap iframe {
  width: 100%;
  height: 80vh;
  border: none;
}
.parking-iframe-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

@media (max-width: 1280px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px 18px 40px;
    gap: 18px;
  }

  .sidebar {
    position: fixed;
    top: 14px;
    left: 14px;
    bottom: 14px;
    width: min(320px, 78vw);
    height: auto;
    padding: 18px 14px 14px;
    transform: translateX(-112%);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    z-index: 80;
    overflow-y: auto;
    border-radius: 12px;
    background: #1b2a3d;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 28px 56px rgba(14, 24, 33, 0.34);
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: grid;
    grid-column: 1;
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .topbar {
    position: sticky;
    top: 14px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px 14px;
    gap: 8px 10px;
    z-index: 35;
    align-items: center;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .brand {
    padding: 8px 10px 4px;
  }

  .mobile-dock {
    display: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 18px 18px 80px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 14px 16px;
  }

  .topbar-desc {
    max-width: none;
    font-size: 12px;
  }

  .dashboard-grid,
  .building-grid,
  .module-grid,
  .lease-cards,
  .lease-grid,
  .kanban,
  .kanban-board,
  .matrix-grid,
  .split-grid,
  .analytics-grid,
  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  html,
  body,
  .app-shell,
  .main-panel {
    overflow-y: auto;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }

  body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    padding: calc(6px + env(safe-area-inset-top)) 10px calc(76px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(44vw, 180px);
    height: auto;
    padding: 12px 8px 10px;
    transform: translateX(-112%);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    z-index: 80;
    overflow-y: auto;
    border-radius: 8px;
    background: #1b2a3d;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 28px 56px rgba(14, 24, 33, 0.34);
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-backdrop,
  .mobile-dock {
    display: block;
  }

  .menu-toggle {
    display: grid;
    grid-column: 1;
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .topbar {
    position: sticky;
    top: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 10px 12px;
    gap: 6px 10px;
    z-index: 35;
    backdrop-filter: none;
    align-items: start;
  }

  .brand {
    padding: 6px 8px 2px;
  }

  .brand h1 {
    font-size: 12px;
  }

  .side-nav {
    gap: 3px;
  }

  .side-link {
    padding: 8px 9px;
    min-height: 36px;
    border-radius: 6px;
    font-size: 12px;
  }

  .sidebar-foot {
    padding: 8px 10px;
    border-radius: 6px;
  }

  .topbar-copy {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
  }

  .topbar-copy .eyebrow {
    font-size: 10px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
    overflow-x: visible;
  }

  .topbar-actions .ghost-btn,
  .topbar-actions .solid-btn {
    justify-content: center;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .topbar-actions .compact-action-btn {
    padding: 4px 7px;
    font-size: 10px;
  }

  .topbar h2 {
    font-size: clamp(16px, 4.4vw, 19px);
    line-height: 1.1;
    word-break: keep-all;
  }

  .topbar-desc {
    font-size: 11px;
    line-height: 1.45;
  }

  .main-panel {
    gap: 10px;
  }

  .panel,
  .analytics-card,
  .ana-panel,
  .viz-section,
  .bld-section {
    padding: 10px;
    border-radius: 8px;
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .hero-grid,
  .feature-grid,
  .building-grid,
  .lease-cards,
  .lease-grid,
  .kanban,
  .kanban-board,
  .dashboard-grid,
  .module-grid,
  .matrix-grid,
  .split-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .building-meta,
  .lease-meta {
    grid-template-columns: 1fr;
  }

  .ana-tabs {
    position: sticky;
    top: calc(env(safe-area-inset-top) + 72px);
    z-index: 30;
    padding: 3px;
    gap: 3px;
    border-radius: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  .ana-tab {
    padding: 7px 10px;
    min-height: 30px;
    font-size: 11px;
    flex: 0 0 auto;
  }

  .plan-floor-card {
    padding: 14px;
  }

  .plan-floor-head,
  .plan-preview-meta,
  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-floor-stat {
    white-space: normal;
  }

  .plan-floor-body,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .plan-room-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .permission-options {
    gap: 6px;
  }

  .permission-option {
    font-size: 11px;
    padding: 5px 8px;
  }

  .table-scroller {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-scroller.keep-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .mobile-list-view {
    display: grid;
    gap: 8px;
  }

  .table-scroller.keep-scroll {
    display: none;
  }

  .mobile-wide-table {
    min-width: 620px;
  }

  .mobile-wide-table th,
  .mobile-wide-table td {
    padding: 7px 8px;
    font-size: 11px;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  [data-page="leases"] .mobile-wide-table th:nth-child(4),
  [data-page="leases"] .mobile-wide-table td:nth-child(4),
  [data-page="leases"] .mobile-wide-table th:nth-child(8),
  [data-page="leases"] .mobile-wide-table td:nth-child(8),
  [data-page="rooms"] .mobile-wide-table th:nth-child(5),
  [data-page="rooms"] .mobile-wide-table td:nth-child(5),
  [data-page="rooms"] .mobile-wide-table th:nth-child(7),
  [data-page="rooms"] .mobile-wide-table td:nth-child(7) {
    display: none;
  }

  .no-mobile-stack {
    display: table;
    width: 100%;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody {
    display: grid;
    gap: 8px;
  }

  .responsive-table tr {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(82px, 108px) minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(24, 34, 44, 0.1);
  }

  .responsive-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
  }

  .responsive-table td[data-label="操作"] {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .responsive-table td[data-label="操作"]::before {
    margin-bottom: 2px;
  }

  .room-cell {
    width: 96px;
    min-height: 80px;
    height: auto;
    padding: 8px 8px 7px;
    border-radius: 8px;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    gap: 4px;
    flex: 0 0 auto;
  }

  .floor-label {
    width: 44px;
    min-height: 80px;
    font-size: 11px;
    border-radius: 8px;
    border-right: 0;
    background: #f8f9fa;
  }

  .floor-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .floor-rooms {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 0 2px 6px 0;
  }

  .floor-rooms::-webkit-scrollbar {
    height: 6px;
  }

  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    margin: 6px 0;
  }

  .filter-chip {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 7px 10px;
  }

  .filter-stats {
    font-size: 12px;
    line-height: 1.5;
  }

  .room-cell .rm-name,
  .room-cell .rm-tenant,
  .room-cell .rm-tag {
    width: 100%;
    max-width: none;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .room-cell .rm-name {
    font-size: 11px;
    line-height: 1.18;
    -webkit-line-clamp: 2;
  }

  .room-cell .rm-tenant {
    font-size: 9px;
    line-height: 1.25;
    opacity: 0.88;
    -webkit-line-clamp: 2;
  }

  .room-cell .rm-tag {
    font-size: 8px;
    line-height: 1.2;
    opacity: 0.72;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 860px) {
  .ana-tabs {
    padding: 0 12px;
  }

  .ana-tab {
    padding: 8px 12px;
    font-size: 12px;
  }

  .ana-panel {
    padding: 12px;
  }

  .room-cell {
    width: 64px;
    height: 42px;
  }

  .floor-label {
    width: 34px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-inline: 10px;
  }

  .topbar,
  .panel,
  .ana-panel,
  .viz-section {
    padding: 9px 10px;
    border-radius: 8px;
  }

  .topbar h2 {
    font-size: 15px;
  }

  .sidebar {
    width: min(38vw, 148px);
    padding: 10px 8px 8px;
  }

  .menu-toggle {
    width: 30px;
    height: 30px;
  }

  .menu-toggle svg {
    width: 14px;
    height: 14px;
  }

  .topbar {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .topbar-copy {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .side-link {
    padding: 7px 8px;
    font-size: 10px;
  }

  .ana-tabs {
    padding: 2px;
    gap: 2px;
    border-radius: 6px;
    flex-wrap: nowrap;
    top: calc(env(safe-area-inset-top) + 66px);
  }

  .ana-tab {
    padding: 6px 9px;
    min-height: 28px;
    font-size: 10px;
  }

  .mobile-wide-table {
    min-width: 540px;
  }

  .kpi-card {
    padding: 8px 10px;
    gap: 1px;
  }

  .kpi-card strong {
    font-size: 17px;
  }

  .kpi-card span {
    font-size: 10px;
  }

  .kpi-card::after {
    display: none;
  }

  .mobile-wide-table th,
  .mobile-wide-table td {
    padding: 6px 7px;
    font-size: 10px;
    line-height: 1.35;
  }

  .filter-row {
    flex-direction: column;
  }

  .filter-select,
  .filter-input,
  .ghost-btn,
  .solid-btn {
    width: 100%;
  }

  .mobile-dock {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .mobile-dock-track {
    grid-auto-columns: minmax(86px, 1fr);
  }

  .dock-link {
    padding: 10px 8px;
  }

  .room-cell {
    width: 88px;
    min-height: 74px;
    padding: 7px 7px 6px;
  }

  .plan-toolbar {
    gap: 8px;
  }

  .plan-toolbar-note,
  .plan-floor-stat,
  .plan-room-card p,
  .plan-room-card span,
  .detail-card p,
  .detail-list-item span {
    font-size: 11px;
  }

  .plan-room-card {
    padding: 10px;
  }

  .plan-marker {
    width: 14px;
    height: 14px;
  }

  .plan-marker span {
    top: -24px;
    opacity: 1;
    font-size: 9px;
  }

  .permission-group {
    padding: 10px 12px;
  }

  .detail-card,
  .detail-list-item,
  .detail-empty,
  .detail-note {
    padding: 10px 12px;
  }

  .room-cell .rm-name {
    font-size: 10px;
  }

  .room-cell .rm-tenant {
    font-size: 8px;
  }

  .room-cell .rm-tag {
    font-size: 7px;
  }

  .mobile-record {
    padding: 12px;
    gap: 10px;
    border-radius: 8px;
  }

  .mobile-record-head h4 {
    font-size: 14px;
  }

  .mobile-record-meta {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 7px 10px;
  }

  .mobile-record-meta span {
    font-size: 10px;
  }

  .mobile-record-meta strong {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes surfaceIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar,
.panel,
.ana-panel,
.viz-section,
.bld-section {
  animation: surfaceIn 0.42s ease both;
}

@media (min-width: 1281px) {
  .sidebar {
    animation: surfaceIn 0.42s ease both;
  }
}

/* ═══════ 经营分析可视化 ═══════ */

/* Tab 导航 */
.ana-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  background: transparent;
  border-radius: 0;
  overflow-x: auto;
  border: none;
  border-bottom: 1px solid var(--line);
}

.ana-tab {
  padding: 10px 20px;
  border-radius: 0;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.ana-tab:hover {
  color: var(--text);
}

.ana-tab.active {
  color: var(--teal);
  font-weight: 600;
  border-bottom-color: var(--teal);
  background: transparent;
  box-shadow: none;
}

/* Tab 面板 */
.ana-panel {
  display: none;
  padding: 20px 24px;
}

.ana-panel.active {
  display: block;
}

/* 可视化区块 */
.viz-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
}

.viz-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.viz-section .viz-desc {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* 统计表格 */
.viz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.viz-table th {
  background: #f8faf9;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.viz-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f3f2;
}

.viz-table tr:hover {
  background: #f8faf9;
}

.viz-table .total-row {
  background: #f0f7f5;
  font-weight: 600;
}

.viz-table .total-row td {
  border-top: 2px solid var(--border);
}

/* 楼栋区块（楼层分布用） */
.bld-section {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  border: 1px solid var(--line);
}

.bld-header {
  padding: 10px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.bld-header:hover {
  background: #f0f4f2;
}

.bld-header h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.bld-badges {
  display: flex;
  gap: 4px;
}

.bld-badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.bld-badge.occ {
  background: #dbeafe;
  color: #1e40af;
}

.bld-badge.vac {
  background: #fef3c7;
  color: #92400e;
}

.bld-badge.spc {
  background: #fce7f3;
  color: #9d174d;
}

.bld-badge.fld {
  background: #fee2e2;
  color: #dc2626;
}

.bld-body {
  padding: 12px 14px;
}

/* 楼层行 */
.floor-row {
  display: flex;
  align-items: stretch;
  margin-bottom: 5px;
  min-height: 38px;
}

.floor-label {
  width: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: #f8f9fa;
  border-radius: 2px 0 0 2px;
  border-right: 2px solid var(--border);
}

.floor-rooms {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  align-items: stretch;
}

/* 房间色块 */
.room-cell {
  width: 76px;
  height: 46px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 9px;
  cursor: default;
  transition: .15s;
  border: 2px solid transparent;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.room-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
  z-index: 10;
}

.room-cell .rm-name {
  font-weight: 700;
  font-size: 10px;
  line-height: 1.1;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-cell .rm-tenant {
  font-size: 7px;
  opacity: .8;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
  margin-top: 1px;
}

.room-cell .rm-tag {
  font-size: 7px;
  opacity: .6;
  line-height: 1;
}

/* 房间状态 */
.room-cell.rc-vacant {
  background: repeating-linear-gradient(45deg,#fefce8,#fefce8 3px,#fef9c3 3px,#fef9c3 6px);
  color: #a16207;
  border-color: #fbbf24;
}

.room-cell.rc-sealed {
  background: repeating-linear-gradient(45deg,#fce4ec,#fce4ec 3px,#f8bbd0 3px,#f8bbd0 6px);
  color: #c62828;
  border-color: #ef5350;
}

.room-cell.rc-related {
  background: repeating-linear-gradient(45deg,#e8eaf6,#e8eaf6 3px,#c5cae9 3px,#c5cae9 6px);
  color: #283593;
  border-color: #5c6bc0;
}

.room-cell.rc-self {
  background: repeating-linear-gradient(45deg,#e0f2f1,#e0f2f1 3px,#b2dfdb 3px,#b2dfdb 6px);
  color: #00695c;
  border-color: #26a69a;
}

.room-cell.rc-other {
  background: repeating-linear-gradient(45deg,#efebe9,#efebe9 3px,#d7ccc8 3px,#d7ccc8 6px);
  color: #4e342e;
  border-color: #8d6e63;
}

.room-cell.rc-filed {
  outline: 3px solid #dc2626;
  outline-offset: -1px;
}

.room-cell.rc-filed::after {
  content: "备";
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 6px;
  color: #dc2626;
  font-weight: 900;
}

/* 堆叠条形图 */
.stacked-bar-row {
  margin-bottom: 10px;
}

.stacked-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 11px;
}

.stacked-bar-label strong {
  font-weight: 600;
}

.stacked-bar-label span {
  color: var(--muted);
  font-size: 10px;
}

/* 到期预警卡片 */
.expiry-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.expiry-card {
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  border-left: 4px solid #f59e0b;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  border-left-width: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.expiry-card.urgent {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.expiry-card.soon {
  border-left-color: #f97316;
}

.expiry-card .ec-label {
  font-size: 9px;
  color: var(--muted);
}

.expiry-card .ec-value {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.expiry-card .ec-sub {
  font-size: 9px;
  color: var(--muted);
}

/* 到期范围按钮 */
.expiry-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.expiry-filter span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.ef-btn {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.ef-btn.active {
  border-color: var(--amber);
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

/* 价格条 */
.price-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.price-bar-row .pb-bar {
  height: 16px;
  border-radius: 3px;
  background: var(--teal);
  min-width: 2px;
}

.price-bar-row .pb-label {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

/* 满租预测高亮行 */
.predict-row {
  background: #fef3c7;
  padding: 10px;
  font-size: 11px;
  color: #92400e;
}

.predict-row strong {
  font-size: 15px;
}

/* ===== v2.0 新增样式 ========== */

/* 紧凑表格 */
.data-table.compact th,
.data-table.compact td {
  font-size: 11px;
  padding: 6px 8px;
}

.data-table.compact {
  border-spacing: 0;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar .filter-select,
.filter-bar .filter-input {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.filter-bar .filter-select {
  min-width: 100px;
}

.filter-bar .filter-input {
  min-width: 140px;
}

/* 移动原生列表 */
.mobile-record {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.mobile-record-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.mobile-record-head h4 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.28;
}

.mobile-record-eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobile-record-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-record-meta {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 8px 12px;
}

.mobile-record-meta span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.mobile-record-meta strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mobile-record-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-record-actions .mini-action {
  flex: 1 1 120px;
  justify-content: center;
}

.mobile-empty {
  padding: 16px 14px;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.72);
  border: 1px dashed rgba(24,34,44,0.12);
}

/* 侧边栏用户信息 */
.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: auto;
}

.sidebar-foot #userDisplay {
  font-size: 11px;
  color: rgba(255,255,255,.7);
}

/* 筛选按钮组(房源/合同页) */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.filter-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.5);
  transition: all .15s;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.filter-chip:hover {
  border-color: var(--teal);
}

/* 筛选统计行 */
.filter-stats {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0 8px;
}

.filter-stats strong {
  color: var(--text);
}

/* 跟进记录展开 */
.followup-toggle {
  font-size: 11px;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
}

.followup-panel {
  padding: 8px 12px;
  background: #f8f6f0;
  border-radius: 6px;
  margin: 4px 0;
}

.followup-item {
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.followup-item:last-child {
  border-bottom: none;
}

.followup-item .fu-meta {
  color: var(--muted);
  font-size: 10px;
}

/* 招商推进状态 */
.neg-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
}

.neg-badge.neg-empty {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
}

.neg-badge.neg-consult {
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}

.neg-badge.neg-visit {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.neg-badge.neg-talking {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.neg-badge.neg-locked {
  background: rgba(16, 185, 129, 0.14);
  color: #065f46;
}

.approval-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.approval-pill.draft {
  background: rgba(148, 163, 184, 0.12);
  color: #475569;
}

.approval-pill.pending {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.approval-pill.approved {
  background: rgba(16, 185, 129, 0.14);
  color: #065f46;
}

.approval-pill.rejected {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

/* 意向状态 */
.intent-status {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.intent-新线索 {
  background: #e0f2fe;
  color: #0369a1;
}

.intent-已咨询 {
  background: #e0f2fe;
  color: #0369a1;
}

.intent-已带看 {
  background: #dbeafe;
  color: #1d4ed8;
}

.intent-谈判中 {
  background: #fef3c7;
  color: #92400e;
}

.intent-锁定 {
  background: #d1fae5;
  color: #065f46;
}

.intent-已签约 {
  background: #d1fae5;
  color: #065f46;
}

.intent-已流失 {
  background: #fee2e2;
  color: #991b1b;
}

/* 财务预警 */
.finance-meter {
  height: 24px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  margin: 8px 0;
}

.finance-meter-fill {
  height: 100%;
  border-radius: 6px;
  transition: width .3s;
}

.finance-meter-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  font-size: 11px;
  font-weight: 700;
}

.finance-risk-table td {
  font-size: 12px;
}

.mobile-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 8px;
  padding: 5px;
  border-radius: 10px;
  background: #1b2a3d;
  box-shadow: 0 12px 24px rgba(15, 25, 34, 0.35);
  overflow-x: auto;
  display: none;
  z-index: 100;
  /* 启用GPU层提升绘制，避免滚动时重绘整个dock */
  transform: translateZ(0);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

.mobile-dock-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(92px, 1fr);
  gap: 8px;
  min-width: 100%;
}

.dock-link {
  display: grid;
  gap: 1px;
  padding: 7px 8px;
  color: rgba(245, 239, 228, 0.72);
  text-decoration: none;
  text-align: center;
  border-radius: 8px;
  white-space: nowrap;
}

.dock-link strong {
  font-size: 11px;
}

.dock-index {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(245, 239, 228, 0.42);
}

.dock-link.active {
  color: #1b2a3d;
  background: #2d4159;
  box-shadow: none;
}

.dock-link.active .dock-index {
  color: rgba(16, 32, 45, 0.58);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  z-index: 70;
  border: 0;
  padding: 0;
  background: rgba(15, 25, 34, 0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  touch-action: auto;
  transition: opacity 0.22s ease;
  cursor: pointer;
  display: none;
}

/* Plan page styles */
.plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.plan-toolbar-note {
  font-size: 12px;
  color: var(--muted);
}

.plan-floor-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.plan-floor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.plan-floor-head h3 {
  margin: 0;
}

.plan-floor-stat {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.plan-floor-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.plan-preview {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.plan-preview-stack {
  position: relative;
}

.plan-preview img {
  width: 100%;
  max-height: 520px;
  border-radius: 8px;
  object-fit: contain;
  cursor: zoom-in;
  background: #fff;
}

.plan-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.88);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.28);
  cursor: pointer;
}

.plan-marker span {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(24, 34, 44, 0.92);
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.plan-marker:hover span {
  opacity: 1;
}

.plan-room-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.plan-room-card {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.plan-room-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.plan-room-card.rc-vacant {
  background: #fefce8;
  border-color: #fbbf24;
}

.plan-room-card.rc-sealed {
  background: #fce4ec;
  border-color: #ef5350;
}

.plan-room-card.rc-related {
  background: #e8eaf6;
  border-color: #5c6bc0;
}

.plan-room-card.rc-self {
  background: #e0f2f1;
  border-color: #26a69a;
}

.plan-room-card.rc-other {
  background: #efe7df;
  border-color: #8d6e63;
}

.plan-room-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.plan-room-top strong {
  font-size: 14px;
  line-height: 1.4;
}

.plan-room-card p {
  margin: 0;
  min-height: 20px;
  font-size: 12px;
  color: var(--text);
}

.plan-room-card span {
  font-size: 11px;
  color: var(--muted);
}

.plan-lightbox {
  display: grid;
  gap: 12px;
}

.plan-lightbox img {
  width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.plan-lightbox-note,
.plan-lightbox-source {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-section {
  margin-top: 16px;
}

.detail-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.detail-card {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
}

.detail-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.detail-empty,
.detail-note {
  padding: 14px;
  border-radius: 6px;
  border: 1px dashed rgba(24, 34, 44, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.6;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
}

.detail-list-item strong {
  font-size: 14px;
}

.detail-list-item span {
  font-size: 12px;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.permission-grid {
  display: grid;
  gap: 12px;
}

.permission-group {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.76);
}

.permission-group h4 {
  margin: 0 0 10px;
  font-size: 13px;
}

.permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(247, 240, 229, 0.92);
  border: 1px solid rgba(24, 34, 44, 0.08);
  font-size: 12px;
  cursor: pointer;
}

.permission-option input {
  margin: 0;
}

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tabs-panel {
  padding-top: 18px;
}

.hero-grid,
.kpi-row,
.building-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.building-card {
  display: block;
}

.task-item {
  padding: 14px;
  background: #fff;
}

.timeline-item {
  padding: 14px;
  background: #fff;
}

.list-card {
  display: block;
}

/* ===== 5001独有样式（仪表盘/日历/决策分析等） ===== */

.kpi-card:hover {
  transform: none;
  box-shadow: var(--shadow-soft);
}

.kpi-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0fdf4;
  background: color-mix(in srgb, var(--kpi-accent, var(--teal)) 10%, transparent);
  color: var(--kpi-accent, var(--teal));
  margin-bottom: 2px;
}

.kpi-icon-wrap svg {
  width: 16px;
  height: 16px;
}

.dash-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 8px 24px !important;
}

.sortable-th,
.room-sortable-th {
  white-space: nowrap;
}

.sortable-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sort-indicator {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.sortable-th.sorted .sort-indicator,
.room-sortable-th.sorted .sort-indicator {
  color: var(--teal);
}

.dash-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.dash-section-caret {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.dash-section-title {
  font-size: 18px;
  font-weight: 700;
}

.dash-section-meta {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.dash-section-body {
  display: block;
}

.dash-section-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.dash-section-header .viz-desc {
  margin: 0;
  font-size: 12px;
}

.rate-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-bar-bg {
  flex: 1;
  height: 6px;
  background: #f1f3f5;
  border-radius: 3px;
  overflow: hidden;
  min-width: 50px;
}

.rate-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

.rate-cell span {
  font-size: 12px;
  font-weight: 700;
  min-width: 42px;
  text-align: right;
}

.stacked-bar-legend {
  display: flex;
  gap: 14px;
  padding: 10px 0 2px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.stacked-bar-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 3px;
}

.stacked-bar-rate {
  font-weight: 700;
  font-size: 12px;
}

.trend-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.trend-chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  transition: box-shadow .15s;
}

.trend-chart-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.trend-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.trend-svg {
  width: 100%;
  height: auto;
}

.trend-svg .trend-val {
  opacity: 0;
  transition: opacity .15s;
}

.trend-svg .trend-dot {
  transition: r .15s;
}

.trend-svg:hover .trend-val { opacity: 1; }

.trend-svg:hover .trend-dot { r: 4.5; }

  .trend-charts-row { grid-template-columns: 1fr; }

.stacked-bar-track {
  display: flex;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5e7eb;
}

.stacked-bar-track > div {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 9px;
  font-weight: 600;
  min-width: 2px;
  transition: width .3s;
}

  .dash-card {
    padding: 10px 12px !important;
    margin: 6px 10px !important;
    border-radius: 8px;
  }

  .dash-section-header {
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
  }

  .dash-section-header h3 {
    font-size: 14px;
  }

  .kpi-icon-wrap {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    margin-bottom: 1px;
  }

  .kpi-icon-wrap svg {
    width: 13px;
    height: 13px;
  }

  .trend-charts-row {
    gap: 10px;
    margin-top: 8px;
  }

  .trend-chart-card {
    padding: 10px 12px;
    border-radius: 8px;
  }

  .trend-chart-title {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .stacked-bar-row {
    padding: 8px 10px;
    margin-bottom: 8px;
  }

  .stacked-bar-label strong {
    font-size: 13px;
  }

  .stacked-bar-track {
    height: 24px;
  }

  .stacked-bar-legend {
    gap: 10px;
    font-size: 12px;
  }

  .rate-cell span {
    font-size: 12px;
    min-width: 36px;
  }

  .rate-bar-bg {
    min-width: 36px;
  }

  .kpi-icon-wrap {
    display: none;
  }

  .trend-chart-card {
    padding: 8px 10px;
  }

  .trend-chart-title {
    font-size: 11px;
  }

  .stacked-bar-row {
    padding: 6px 8px;
    margin-bottom: 6px;
  }

  .stacked-bar-label strong {
    font-size: 11px;
  }

  .stacked-bar-track {
    height: 18px;
  }

  .stacked-bar-track > div {
    font-size: 7px;
  }

.stacked-bar-row {
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #fafbfc;
  border-radius: 8px;
  border: 1px solid #f0f1f3;
  transition: background .15s;
}

.stacked-bar-row:hover {
  background: #f5f6f8;
}

.stacked-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.stacked-bar-label strong {
  font-weight: 700;
  font-size: 13px;
}

.stacked-bar-label span {
  color: var(--muted);
  font-size: 11px;
}

.more-action-item {
  padding: 5px 12px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
}

.more-action-item:hover {
  background: var(--bg-alt, #f3f4f6);
}

.dc-overlay .dc-modal {
  width: min(780px, 94vw);
  max-height: 90vh;
}

.dc-body { padding: 0 !important; }

.dc-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 20px; }

.dc-tab-btn { flex: none; padding: 10px 16px; font-size: 13px; font-weight: 500; border: none; background: none; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }

.dc-tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }

.dc-tab-panel { display: none; padding: 16px 20px; }

.dc-tab-panel.active { display: block; }

.dc-section { margin-bottom: 14px; }

.dc-section-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

.dc-section-title small { font-weight: 400; color: var(--muted); }

.dc-grid { display: grid; gap: 8px; }

.dc-grid-2 { grid-template-columns: 1fr 1fr; }

.dc-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.dc-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.dc-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }

.dc-field label small { font-size: 10px; }

.dc-field input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; background: var(--bg); color: var(--text); outline: none; }

.dc-field input:focus { border-color: var(--teal); background: white; }

.dc-readonly { padding: 6px 8px; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 6px; border: 1px solid var(--line); }

.dc-sc { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }

.dc-sc.best { border-color: var(--teal); border-width: 2px; }

.dc-sc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.dc-sc-name { font-size: 12px; font-weight: 600; }

.dc-best-tag { background: var(--teal); color: white; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 500; }

.dc-sc-result { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

.dc-sc-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; text-align: center; }

.dc-metric-label { display: block; font-size: 9px; color: var(--muted); }

.dc-metric-val { display: block; font-size: 13px; font-weight: 700; margin-top: 1px; }

.dc-metric-val.dc-highlight { color: var(--teal); font-size: 14px; }

.dc-decision { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0; }

.dc-decision-title { font-size: 12px; font-weight: 600; margin-bottom: 6px; }

.dc-bar-track { height: 6px; border-radius: 3px; background: var(--bg); margin: 4px 0; position: relative; }

.dc-bar-fill { height: 100%; border-radius: 3px; transition: width .3s; }

.dc-bar-marker { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,.3); transform: translateX(-50%); }

.dc-bar-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

.dc-verdict { margin-top: 8px; padding: 8px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1.4; }

.dc-verdict-good { background: #ecfdf5; color: #065f46; }

.dc-verdict-warn { background: #fffbeb; color: #92400e; }

.dc-verdict-bad { background: #fef2f2; color: #991b1b; }

.dc-tenant { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; }

.dc-tenant.selected { border-color: var(--teal); border-width: 2px; background: #f0fdfa; }

.dc-tenant-info { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.dc-tenant-info input { border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; font-size: 11px; background: white; outline: none; }

.dc-tenant-acts { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.dc-unit { font-size: 10px; color: var(--muted); }

.dc-kpi-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }

.dc-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }

.dc-kpi-label { font-size: 10px; color: var(--muted); }

.dc-kpi-value { font-size: 16px; font-weight: 700; margin-top: 2px; }

.dc-kpi-value small { font-size: 11px; font-weight: 400; color: var(--muted); }

.dc-kpi-note { font-size: 10px; color: var(--muted); margin-top: 1px; }

.dc-tip { background: #f0f4ff; border: 1px solid #c7d4f0; border-radius: 6px; padding: 8px 10px; font-size: 12px; color: #3b5998; line-height: 1.4; }

.dc-tip.dc-tip-bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

@media (max-width: 600px) {
  .dc-grid-4 { grid-template-columns: 1fr 1fr; }
  .dc-kpi-row { grid-template-columns: 1fr; }
  .dc-overlay .dc-modal { width: 98vw; max-height: 95vh; }
}

.cal-page { display: flex; flex-direction: column; gap: 12px; }

.cal-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }

.cal-toolbar-left { display: flex; align-items: center; gap: 6px; }

.cal-toolbar-right { display: flex; align-items: center; gap: 8px; }

.cal-nav-btn { background: none; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 7px; cursor: pointer; color: #64748b; transition: all .15s; display: flex; align-items: center; }

.cal-nav-btn:hover { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

.cal-today-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 12px; font-size: 11px; font-weight: 600; color: #475569; cursor: pointer; transition: all .15s; }

.cal-today-btn:hover { background: #e2e8f0; }

.cal-open-btn { font-size: 11px; color: #64748b; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 6px; transition: all .15s; }

.cal-open-btn:hover { background: #f1f5f9; color: #334155; }

.cal-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }

.cal-filter-chip { border: 1.5px solid; border-radius: 20px; padding: 3px 12px; font-size: 11px; font-weight: 600; cursor: pointer; background: #fff; transition: all .15s; display: inline-flex; align-items: center; gap: 4px; }

.cal-filter-chip:hover { opacity: .85; }

.cal-filter-chip.active { box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.cal-filter-count { font-size: 10px; font-weight: 700; opacity: .7; }

.cal-body { display: grid; grid-template-columns: 1fr 320px; gap: 16px; min-height: 500px; }

.cal-grid-wrap { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }

.cal-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #e2e8f0; background: #f8fafc; }

.cal-weekday { text-align: center; font-size: 11px; font-weight: 600; color: #64748b; padding: 8px 0; }

.cal-weekday.cal-weekend { color: #cbd5e1; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-day { min-height: 90px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; padding: 4px 6px; cursor: pointer; transition: background .12s; position: relative; }

.cal-day:hover { background: #f8fafc; }

.cal-day-empty { background: #fafbfc; cursor: default; }

.cal-day-num { font-size: 12px; font-weight: 600; color: #64748b; }

.cal-day-today .cal-day-num { background: #3b82f6; color: #fff; border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

.cal-day-selected { background: #eff6ff !important; box-shadow: inset 0 0 0 2px #3b82f6; border-radius: 2px; }

.cal-day-dots { display: flex; gap: 3px; margin-top: 2px; flex-wrap: wrap; }

.cal-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.cal-dot-more { font-size: 9px; color: #94a3b8; font-weight: 600; }

.cal-day-previews { margin-top: 3px; display: flex; flex-direction: column; gap: 2px; }

.cal-day-preview { font-size: 10px; padding: 1px 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }

.cal-day-preview-more { background: transparent; color: #94a3b8; font-size: 9px; border-left: none; }

.cal-detail { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 16px; overflow-y: auto; max-height: calc(100vh - 220px); }

.cal-detail-placeholder { color: #cbd5e1; font-size: 13px; text-align: center; padding: 60px 16px; }

.cal-detail-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }

.cal-detail-date { font-size: 20px; font-weight: 800; color: #1e293b; }

.cal-detail-weekday { font-size: 13px; color: #64748b; font-weight: 500; }

.cal-detail-count { font-size: 11px; color: #94a3b8; margin-left: auto; }

.cal-detail-empty { color: #cbd5e1; font-size: 12px; text-align: center; padding: 40px 16px; }

.cal-detail-list { display: flex; flex-direction: column; gap: 10px; }

.cal-event-card { padding: 10px 12px; border-radius: 8px; transition: box-shadow .12s; }

.cal-event-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.cal-event-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

.cal-event-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }

.cal-event-prio { font-size: 10px; font-weight: 700; }

.cal-event-title { font-size: 13px; font-weight: 600; line-height: 1.4; word-break: break-all; }

.cal-event-desc { font-size: 11px; color: #64748b; margin-top: 4px; line-height: 1.5; word-break: break-all; }

.cal-event-status { font-size: 10px; color: #94a3b8; margin-top: 4px; }

.cal-event-link { font-size: 11px; color: #3b82f6; text-decoration: none; margin-top: 6px; display: inline-block; font-weight: 600; }

.cal-event-link:hover { text-decoration: underline; }

  .cal-body { grid-template-columns: 1fr; }

  .cal-detail { max-height: none; border-top: 1px solid #e2e8f0; }

  .cal-day { min-height: 52px; padding: 3px 2px; }

  .cal-day-previews { display: none; }

  .cal-day-num { font-size: 11px; }

  .cal-toolbar { gap: 6px; }

  .cal-open-btn { display: none; }

  .cal-event-card { padding: 8px 10px; }

  .cal-detail-date { font-size: 16px; }

  .cal-day { min-height: 42px; padding: 2px 1px; }

  .cal-day-dots { gap: 2px; }

  .cal-dot { width: 5px; height: 5px; }

  .cal-today-btn { padding: 3px 8px; font-size: 10px; }

  .cal-filter-chip { font-size: 10px; padding: 2px 8px; }

@media (max-width: 480px) {
  /* 根源修复：阻止任何子元素撑宽页面 */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .app-shell {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-inline: 6px !important;
  }
  .main-panel {
    overflow-x: hidden;
    min-width: 0;
    max-width: 100%;
  }
  .panel,
  .viz-section,
  .ana-panel,
  .bld-section,
  .dash-card,
  .topbar {
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
  }
  /* 所有多列grid强制单列 */
  .forecast-grid,
  .ai-insight-grid,
  .feature-grid,
  .module-grid,
  .lease-cards,
  .lease-grid,
  .matrix-grid,
  .kanban,
  .kanban-board,
  .hero-grid,
  .building-grid,
  .dashboard-grid,
  .analytics-grid,
  .split-grid {
    grid-template-columns: 1fr !important;
  }

  /* 决策分析弹窗网格 */
  .dc-grid-2,
  .dc-grid-3,
  .dc-grid-4 {
    grid-template-columns: 1fr !important;
  }
  .dc-sc-metrics {
    grid-template-columns: 1fr 1fr !important;
  }
  .dc-kpi-row {
    grid-template-columns: 1fr !important;
  }

  /* KPI行：2列 */
  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px;
  }

  /* 趋势图单列 */
  .trend-charts-row {
    grid-template-columns: 1fr !important;
  }

  /* 通知面板自适应 */
  #notifPanel {
    width: calc(100vw - 20px) !important;
    right: -10px !important;
  }

  /* 看板列紧凑化 */
  .kanban-col {
    padding: 10px;
  }
  .kanban-col h4 {
    font-size: 14px;
  }
  .kanban-card {
    padding: 10px;
  }
  .kanban-card p {
    font-size: 12px;
  }

  /* 表格自动滚动 */
  .table-scroller {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 筛选栏竖排 */
  .filter-row {
    flex-direction: column !important;
    gap: 6px;
  }
  .filter-row > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* 弹窗全屏 */
  .modal-box,
  .dc-overlay .dc-modal {
    width: 96vw !important;
    max-width: none !important;
    margin: 8px auto;
  }

  /* 预警卡片单列 */
  .expiry-cards {
    grid-template-columns: 1fr !important;
  }

  /* 按钮行wrap */
  .detail-actions,
  .topbar-actions {
    flex-wrap: wrap !important;
  }
  .detail-actions > *,
  .topbar-actions > * {
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════
   Visual Editor — FAB + Slide-out Panel
   ═══════════════════════════════════════════ */

/* 侧滑面板 */
#ve-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--border, #e2e8f0);
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
#ve-panel.ve-open {
  right: 0;
}

#ve-panel.ve-minimized {
  right: 0;
  width: 68px;
}

#ve-panel.ve-minimized .ve-tabs,
#ve-panel.ve-minimized .ve-body {
  display: none !important;
}

/* 面板头部 */
.ve-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  flex-shrink: 0;
}
.ve-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #1e293b);
}
.ve-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ve-header-btn {
  border: 1px solid var(--border, #cbd5e1);
  background: #fff;
  color: var(--text, #1e293b);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ve-header-btn:hover {
  background: #f1f5f9;
}
.ve-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #1e293b);
}
.ve-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted, #64748b);
  padding: 0 4px;
  line-height: 1;
}
.ve-close:hover { color: var(--text, #1e293b); }

#ve-panel.ve-minimized .ve-header {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 8px;
  height: 100%;
}

#ve-panel.ve-minimized .ve-header-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
}

#ve-panel.ve-minimized .ve-header-actions {
  flex-direction: column;
}

/* Tab栏 */
.ve-tabs {
  display: flex;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: #f8fafc;
}
.ve-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #64748b);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.ve-tab:hover { color: var(--text, #1e293b); }
.ve-tab-active {
  color: var(--teal, #0f766e);
  border-bottom-color: var(--teal, #0f766e);
}

/* 面板内容区 滚动 */
.ve-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* 样式组 */
.ve-group {
  margin-bottom: 20px;
}
.ve-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.ve-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.ve-row label {
  font-size: 13px;
  color: var(--text, #1e293b);
  white-space: nowrap;
  min-width: 70px;
}

/* 颜色选择器 */
.ve-color-input {
  width: 36px;
  height: 30px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: #fff;
}

/* 范围滑块 */
.ve-range-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.ve-range-input {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}
.ve-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--teal, #0f766e);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.ve-range-val {
  font-size: 12px;
  color: var(--muted, #64748b);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ve-pick-btn {
  width: 100%;
  margin-bottom: 12px;
}

.ve-canvas-btn {
  width: 100%;
  margin-bottom: 12px;
}

.ve-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.ve-field-block > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #1e293b);
}

.ve-input {
  width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  color: var(--text, #1e293b);
  font-size: 13px;
  padding: 9px 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.ve-input:focus {
  border-color: var(--teal, #0f766e);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.ve-input:disabled {
  background: #f8fafc;
  color: var(--muted, #64748b);
  cursor: not-allowed;
}

.ve-textarea {
  min-height: 82px;
  resize: vertical;
  font-family: inherit;
}

.ve-selected-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 8px;
}

.ve-selected-meta strong {
  font-size: 13px;
  color: var(--text, #1e293b);
}

.ve-selected-meta span {
  font-size: 11px;
  color: var(--muted, #64748b);
  line-height: 1.45;
  word-break: break-all;
}

.ve-batch-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 10px;
}

.ve-mini-btn {
  border: 1px solid var(--border, #cbd5e1);
  background: #fff;
  color: var(--text, #1e293b);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.ve-mini-btn:hover {
  background: #f8fafc;
  border-color: var(--teal, #0f766e);
}

.ve-clipboard-state {
  font-size: 11px;
  color: var(--muted, #64748b);
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.ve-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.ve-tree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 8px 8px calc(8px + var(--ve-indent, 0px));
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.ve-tree-row:hover {
  background: #f8fafc;
}

.ve-tree-row.is-active {
  background: #eef2ff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.ve-tree-row.is-checked {
  background: #ecfeff;
}

.ve-tree-check {
  margin-top: 3px;
  flex-shrink: 0;
}

.ve-tree-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ve-tree-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.35;
}

.ve-tree-key {
  font-size: 10px;
  color: var(--muted, #64748b);
  line-height: 1.35;
  word-break: break-all;
}

/* 布局列表 */
.ve-layout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ve-layout-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: grab;
  transition: background .15s, box-shadow .15s;
  user-select: none;
}
.ve-layout-item:hover {
  background: #f0fdfa;
  border-color: var(--teal, #0f766e);
}
.ve-layout-item.ve-dragging {
  opacity: .4;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.ve-drag-handle {
  font-size: 16px;
  color: var(--muted, #64748b);
  cursor: grab;
  line-height: 1;
}
.ve-layout-label {
  flex: 1;
  font-size: 13px;
  color: var(--text, #1e293b);
  font-weight: 500;
}

/* 尺寸标签 */
.ve-size-badge {
  font-size: 11px;
  color: var(--muted, #64748b);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ve-hint {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ── 画布编辑模式 ── */
.ve-canvas-mode > *:not(.topbar) {
  position: relative;
}
.ve-editable {
  outline: 2px dashed #94a3b8;
  outline-offset: -2px;
  transition: outline-color .15s;
  position: relative !important;
}
.ve-editable:hover {
  outline-color: var(--teal, #0f766e);
}

body.ve-pick-mode,
body.ve-pick-mode [data-ve-node] {
  cursor: crosshair !important;
}

.ve-node-hover {
  outline: 2px solid rgba(20, 184, 166, 0.86) !important;
  outline-offset: 3px;
}

.ve-node-selected {
  outline: 2px solid rgba(99, 102, 241, 0.92) !important;
  outline-offset: 3px;
}

body.ve-element-canvas-mode {
  cursor: default;
}

body.ve-element-moving,
body.ve-element-moving * {
  user-select: none !important;
}

#ve-element-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10020;
}

#ve-element-overlay.ve-overlay-active {
  pointer-events: none;
}

.ve-element-box {
  position: fixed;
  box-sizing: border-box;
  border: 2px solid rgba(99, 102, 241, 0.95);
  background: rgba(99, 102, 241, 0.08);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.6) inset, 0 10px 30px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
}

.ve-element-toolbar {
  position: absolute;
  left: -2px;
  top: -32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 6px 10px;
  border-radius: 8px 8px 8px 2px;
  background: rgba(30, 41, 59, 0.96);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: move;
  white-space: nowrap;
}

.ve-element-toolbar-label {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ve-element-toolbar-size {
  color: rgba(255,255,255,0.72);
  font-variant-numeric: tabular-nums;
}

.ve-element-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #6366f1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  padding: 0;
  pointer-events: auto;
}

.ve-element-handle-n,
.ve-element-handle-s {
  left: 50%;
  transform: translateX(-50%);
}

.ve-element-handle-e,
.ve-element-handle-w {
  top: 50%;
  transform: translateY(-50%);
}

.ve-element-handle-n { top: -7px; cursor: ns-resize; }
.ve-element-handle-s { bottom: -7px; cursor: ns-resize; }
.ve-element-handle-e { right: -7px; cursor: ew-resize; }
.ve-element-handle-w { left: -7px; cursor: ew-resize; }
.ve-element-handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.ve-element-handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.ve-element-handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.ve-element-handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }

/* 编辑标签 */
.ve-edit-badge {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(99,102,241,0.85);
  padding: 2px 10px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}

/* 拖拽手柄 */
.ve-handle {
  position: absolute;
  z-index: 11;
  background: var(--teal, #0f766e);
  border-radius: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.ve-editable:hover .ve-handle { opacity: 1; }

.ve-handle-r {
  top: 50%;
  right: -4px;
  width: 8px;
  height: 40px;
  transform: translateY(-50%);
  cursor: ew-resize;
  border-radius: 4px;
}
.ve-handle-b {
  bottom: -4px;
  left: 50%;
  width: 40px;
  height: 8px;
  transform: translateX(-50%);
  cursor: ns-resize;
  border-radius: 4px;
}
.ve-handle-c {
  bottom: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  border-radius: 3px;
  background: #6366f1;
}

/* 磁吸参考线 */
#ve-guides {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10001;
}

/* 危险按钮 */
.ve-btn-danger {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}
.ve-btn-danger:hover { background: #dc2626 !important; }

/* ── 变更日志 ── */
.ve-log-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ve-log-entry {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  align-items: baseline;
}
.ve-log-time {
  color: var(--muted, #64748b);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ve-log-user {
  color: var(--teal, #0f766e);
  font-weight: 600;
  white-space: nowrap;
}
.ve-log-action {
  color: var(--text, #1e293b);
}

/* 显隐切换按钮 */
.ve-vis-toggle {
  background: none;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  width: 32px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.ve-vis-toggle.on {
  background: #d1fae5;
  border-color: #6ee7b7;
}

/* 操作按钮 */
.ve-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 0;
  border-top: 1px solid var(--border, #e2e8f0);
  margin-top: 16px;
}
.ve-btn {
  flex: 1;
  min-width: 120px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--text, #1e293b);
  cursor: pointer;
  transition: background .15s;
}
.ve-btn:hover { background: #f1f5f9; }
.ve-btn-primary {
  background: var(--teal, #0f766e);
  color: #fff;
  border-color: var(--teal, #0f766e);
}
.ve-btn-primary:hover { background: #0d6560; }

/* 布局grid在移动端回退单列 */
@media (max-width: 768px) {
  .main-panel[style*="grid"] {
    grid-template-columns: 1fr !important;
  }
  .main-panel[style*="grid"] > * {
    grid-column: 1 / -1 !important;
  }
}

/* 拖拽手柄触屏增大 */
@media (pointer: coarse) {
  .ve-handle-r { width: 14px; height: 50px; right: -7px; }
  .ve-handle-b { height: 14px; width: 50px; bottom: -7px; }
  .ve-handle-c { width: 20px; height: 20px; bottom: -8px; right: -8px; }
  .ve-editable .ve-handle { opacity: 0.7; }
}

/* 移动端适配 */
@media (max-width: 480px) {
  #ve-panel {
    width: 100vw;
    right: -100vw;
  }
  .ve-batch-actions {
    grid-template-columns: 1fr;
  }
}

/* ── Occupancy scope inline toggle ── */
.occ-scope-inline {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.occ-scope-opt {
  flex: 1;
  background: var(--bg, #f4f5f7);
  border: 1px solid var(--line, #e5e6eb);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  color: var(--muted, #8f959e);
  text-align: center;
  white-space: nowrap;
}
.occ-scope-opt.active {
  background: var(--teal, #0f766e);
  color: #fff;
  font-weight: 600;
  border-color: var(--teal, #0f766e);
}
