/* ===== CSS Variables ===== */
:root {
  --primary: #2d6a4f;
  --primary-light: #52b788;
  --primary-lighter: #95d5b2;
  --primary-dark: #1b4332;
  --accent: #e9c46a;
  --accent-dark: #d4a72c;
  --bg: #f0f4f0;
  --bg-card: #ffffff;
  --bg-hover: #f8f9fa;
  --text: #1a2e22;
  --text-secondary: #6c757d;
  --text-light: #adb5bd;
  --border: #e3e8e5;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  /* 状态色 */
  --status-vacant: #52b788;
  --status-vacant-bg: #d8f3dc;
  --status-occupied: #e76f51;
  --status-occupied-bg: #fce4dc;
  --status-reserved: #4a90d9;
  --status-reserved-bg: #d6eaf8;
  --status-maintenance: #6c757d;
  --status-maintenance-bg: #e9ecef;

  /* 房型 */
  --type-shared: #e9c46a;
  --type-standard: #4a90d9;
  --type-premium: #9b5de5;

  --sidebar-w: 240px;
  --topbar-h: 60px;
}

/* ===== Icon Styles ===== */
.icon-stat {
  width: 28px;
  height: 28px;
  display: block;
}

.icon-btn {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.icon-inline {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.icon-inline-lg {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
}

/* ===== Reset ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Layout ===== */
#app {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.logo-text span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
}

.nav-item.nav-divider {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: 8px 0;
  padding: 0;
  cursor: default;
}

.nav-item.nav-divider:hover {
  background: none;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-stats .qs-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.quick-stats .qs-item span:last-child {
  color: #fff;
  font-weight: 600;
}

.sidebar-settings {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-settings .sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-settings .sync-indicator:hover {
  color: rgba(255, 255, 255, 0.9);
}

.sidebar-settings .sync-indicator .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.btn-icon-settings {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-icon-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.topbar-left h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 4px;
}

.date-display {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Sync indicator */
.sync-indicator {
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-label {
  font-size: 12px;
  color: var(--text-light);
}

/* Settings button */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* Settings card pre */
.settings-sql {
  background: var(--bg-page);
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  overflow-x: auto;
  margin: 8px 0;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.page-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ===== Dashboard ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.vacant { background: var(--status-vacant-bg); color: var(--status-vacant); }
.stat-icon.occupied { background: var(--status-occupied-bg); color: var(--status-occupied); }
.stat-icon.reserved { background: var(--status-reserved-bg); color: var(--status-reserved); }
.stat-icon.revenue { background: #fff3cd; color: var(--accent-dark); }
.stat-icon.rate { background: #d6eaf8; color: #2d6a9f; }

.stat-info h3 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

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

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* 入住率环形图 */
.occupancy-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.occupancy-ring svg {
  width: 160px;
  height: 160px;
}

.occupancy-ring .ring-text {
  font-size: 32px;
  font-weight: 800;
  fill: var(--primary);
}

.occupancy-ring .ring-label {
  font-size: 12px;
  fill: var(--text-secondary);
}

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-item-info .badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.list-item-info .room-badge {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== Village Map ===== */
.map-container {
  background: linear-gradient(135deg, #dce8e0 0%, #e8f0e8 100%);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.map-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.map-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.village-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  background: #e3ede5;
}

.building-group {
  cursor: pointer;
  transition: opacity 0.2s;
}

.building-group:hover {
  opacity: 0.85;
}

.building-rect {
  rx: 6;
  transition: filter 0.2s;
}

.building-group:hover .building-rect {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.building-label {
  font-size: 12px;
  font-weight: 600;
  fill: #fff;
  text-anchor: middle;
  pointer-events: none;
}

.building-count {
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.8);
  text-anchor: middle;
  pointer-events: none;
}

/* 房间弹出面板 */
.building-detail-panel {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  width: 360px;
  max-height: 80vh;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.building-detail-panel.show {
  display: flex;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translate(100%, -50%); opacity: 0; }
  to { transform: translate(0, -50%); opacity: 1; }
}

.panel-header {
  padding: 16px 20px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.panel-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
}

.panel-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.room-card {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--status-vacant);
  transition: transform 0.15s;
  cursor: pointer;
}

.room-card:hover {
  transform: translateX(4px);
}

.room-card.status-occupied { border-left-color: var(--status-occupied); }
.room-card.status-reserved { border-left-color: var(--status-reserved); }
.room-card.status-maintenance { border-left-color: var(--status-maintenance); }

.room-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-card-name {
  font-weight: 600;
  font-size: 14px;
}

.room-card-type {
  font-size: 12px;
  color: var(--text-secondary);
}

.room-card-status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* ===== Calendar ===== */
.calendar-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-grid-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
}

.calendar-grid {
  display: grid;
  font-size: 12px;
  min-width: 800px;
}

.cal-header-cell {
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg-hover);
  position: sticky;
  top: 0;
  z-index: 5;
  min-width: 32px;
}

.cal-header-cell.weekend {
  color: var(--status-occupied);
}

.cal-header-cell.today {
  background: var(--primary-light);
  color: #fff;
}

.cal-room-label {
  padding: 8px 12px;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg-hover);
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 100px;
  white-space: nowrap;
}

.cal-cell {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-height: 36px;
  min-width: 32px;
  position: relative;
  cursor: pointer;
}

.cal-cell.today {
  background: rgba(82, 183, 136, 0.05);
}

.cal-booking {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.cal-booking.status-active { background: var(--status-occupied); }
.cal-booking.status-reserved { background: var(--status-reserved); }

/* ===== Tables ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-hover);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

.data-table .actions {
  display: flex;
  gap: 6px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-danger {
  background: var(--status-occupied);
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 8px;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-vacant { background: var(--status-vacant-bg); color: var(--status-vacant); }
.badge-occupied { background: var(--status-occupied-bg); color: var(--status-occupied); }
.badge-reserved { background: var(--status-reserved-bg); color: var(--status-reserved); }
.badge-maintenance { background: var(--status-maintenance-bg); color: var(--status-maintenance); }

.badge-shared { background: #fff3cd; color: var(--accent-dark); }
.badge-standard { background: #d6eaf8; color: #2d6a9f; }
.badge-premium { background: #f0e6fa; color: #7b2cbf; }

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg-card);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.modal-overlay.show {
  display: block;
}

.modal-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-container.show {
  display: block;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { transform: translate(-50%, -45%); opacity: 0; }
  to { transform: translate(-50%, -50%); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 320px;
}

.toast.success { background: var(--primary); }
.toast.error { background: var(--status-occupied); }
.toast.info { background: #2d6a9f; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== Guest View ===== */
.guest-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  border-radius: var(--radius);
  padding: 40px;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.guest-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.guest-hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
}

.guest-hero p {
  font-size: 16px;
  opacity: 0.9;
  position: relative;
}

.guest-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pricing-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  border-top: 4px solid var(--primary-light);
  transition: transform 0.2s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
  border-top-color: var(--accent);
}

.pricing-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.pricing-card .price {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  margin: 12px 0;
}

.pricing-card .price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.pricing-card .features {
  list-style: none;
  text-align: left;
  margin: 16px 0;
}

.pricing-card .features li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-card .features li::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8L6.5 11.5L13 5' stroke='%2352b788' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* ===== Filters ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select,
.filter-bar input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
}

.filter-bar .search-input {
  flex: 1;
  min-width: 180px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .page-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-info h3 {
    font-size: 22px;
  }

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

  .modal-container {
    width: 95%;
  }

  .building-detail-panel {
    width: calc(100% - 32px);
    right: 16px;
  }

  /* 移动端表格转卡片布局（仅带 data-label 的响应式表格） */
  .data-table.responsive-table thead {
    display: none;
  }
  .data-table.responsive-table,
  .data-table.responsive-table tbody,
  .data-table.responsive-table tr,
  .data-table.responsive-table td {
    display: block;
    width: 100%;
  }
  .data-table.responsive-table tr {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 6px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }
  .data-table.responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    text-align: right;
  }
  .data-table.responsive-table td:last-child {
    border-bottom: none;
  }
  .data-table.responsive-table td::before {
    content: attr(data-label);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
  }
  .data-table.responsive-table td[colspan]::before {
    content: none;
  }
  .data-table.responsive-table td[colspan] {
    text-align: center;
    justify-content: center;
  }
  .data-table.responsive-table .actions {
    justify-content: flex-end;
  }

  /* 卡片容器在移动端给表格卡片留间距 */
  .card:has(.responsive-table) {
    background: transparent;
    box-shadow: none;
    padding: 0 !important;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.fwrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ===== Admin Login ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 40%, #52b788 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: #fff; border-radius: 16px; padding: 36px 32px;
  width: 90%; max-width: 360px; text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}
.login-box h2 { margin: 0; }
.login-box .login-input {
  width: 100%; padding: 12px 44px 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 16px; outline: none; box-sizing: border-box;
  transition: border-color 0.2s;
}
.login-box .login-input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(82,183,136,0.15); }
.login-box .login-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-light); padding: 4px;
}
.login-box .login-error {
  font-size: 13px; color: var(--status-occupied); margin-top: 6px; min-height: 20px;
}
.login-box .login-btn {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; margin-top: 8px; transition: background 0.2s;
}
.login-box .login-btn:hover { background: var(--primary-dark); }
