/* ==========================================================================
   茱萸ZhuYu Design System & Stylesheet
   Style: Modern Zen / Glassmorphism / Vibrant Harmonious Palette
   ========================================================================== */

:root {
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;

  /* Color Palette - Zen Gold & Deep Indigo */
  --bg-app: #f4f1ea;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #ffffff;
  --bg-sidebar: #1e262c;
  --sidebar-text: #d5d9dc;
  --sidebar-active: #c59b27;

  --primary: #c59b27;
  --primary-hover: #ab841b;
  --primary-light: rgba(197, 155, 39, 0.12);
  --primary-border: rgba(197, 155, 39, 0.3);

  --accent-blue: #2c5282;
  --accent-teal: #2b6cb0;
  --text-main: #2d3748;
  --text-muted: #718096;
  --text-light: #a0aec0;
  --border-color: #e2e8f0;

  /* Status Colors */
  --status-success: #2e7d32;
  --status-success-bg: #e8f5e9;
  --status-warning: #ed6c02;
  --status-warning-bg: #fff4e5;
  --status-danger: #d32f2f;
  --status-danger-bg: #ffebee;
  --status-info: #0288d1;
  --status-info-bg: #e1f5fe;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Layout Grid */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  z-index: 20;
  transition: transform var(--transition-smooth);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #e6c667);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.3);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: #8c9ba5;
}

/* Navigation List */
.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: #a0aec0;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.nav-item.active {
  background: linear-gradient(90deg, rgba(197, 155, 39, 0.25), rgba(197, 155, 39, 0.05));
  color: var(--primary);
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-item .icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

/* User Info Card (底部登录用户信息) */
.user-info-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-avatar {
  font-size: 1.6rem;
  color: var(--primary);
  flex-shrink: 0;
}

.user-details {
  overflow: hidden;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffd54f;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

/* Top Navbar */
.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  height: 64px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
  color: var(--primary);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9400;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.page-header-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Content Container */
.content-wrapper {
  padding: 2rem;
  flex: 1;
}

/* Glass Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(197, 155, 39, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.4);
}

.btn-secondary {
  background: #edf2f7;
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

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

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

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

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

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Stats Counter Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--border-color, #cbd5e0);
  border-radius: 4px;
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.custom-table th {
  background: #f7fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-main);
  background: #ffffff;
  white-space: nowrap;
}

.custom-table tr:hover td {
  background: #f8fafc;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}

.badge i {
  font-size: 0.85em;
  line-height: 1;
  display: inline-block;
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.badge-info {
  background: var(--status-info-bg);
  color: var(--status-info);
}

.badge-gold {
  background: rgba(197, 155, 39, 0.15);
  color: #a37c18;
  border: 1px solid rgba(197, 155, 39, 0.3);
}

/* Dorm Visual Kanban Board */
.kanban-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.kanban-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}

.room-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1.5px solid #e7e2d7;
  box-shadow: 0 1px 4px rgba(44, 37, 29, 0.04);
  display: flex;
  flex-direction: column;
  overflow: visible; /* 允许悬浮名片正常浮出卡片边界 */
  transition: all var(--transition-fast);
  min-height: 140px;
  position: relative;
}

.room-card:hover {
  box-shadow: 0 4px 14px rgba(44, 37, 29, 0.09);
  border-color: #cbd5e1;
  z-index: 10; /* 悬浮时处于上层 */
}

.room-card.male-room {
  border-top: 3.5px solid #2b6cb0;
}

.room-card.female-room {
  border-top: 3.5px solid #d53f8c;
}

.room-card.mixed-room {
  border-top: 3.5px solid #805ad5;
}

.room-header {
  padding: 0.85rem 1rem;
  background: #fbf9f6;
  border-bottom: 1px solid #ebe5d8;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.room-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 28px;
}

.room-title-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1;
}

.room-door-icon {
  color: #64748b;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.room-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.room-alias {
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.room-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.room-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.room-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.room-action-btn.toggle-room-gender-btn:hover {
  border-color: #818cf8;
  color: #4f46e5;
  background: #eef2ff;
}

.room-action-btn.edit-room-btn:hover {
  border-color: #fcd34d;
  color: #b45309;
  background: #fefce8;
}

.room-action-btn.delete-room-btn:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

.room-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.room-meta-occupancy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.room-meta-gender {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.room-gender-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.room-gender-pill.male {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.room-gender-pill.female {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.room-gender-pill.mixed {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.room-gender-pill.toggle-room-gender-btn {
  cursor: pointer;
}

.room-gender-pill.toggle-room-gender-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.bed-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

/* ── Modern Zen SaaS Bed Slots (现代禅意排版与视觉降噪) ── */
.bed-slot {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  cursor: default;
}

.bed-slot[draggable="true"] {
  cursor: grab;
}

.bed-slot[draggable="true"]:active {
  cursor: grabbing;
}

.bed-slot:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.bed-slot.occupied {
  border-color: #e2e8f0;
  background: #ffffff;
}

.bed-slot.occupied:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.bed-slot.has-reservation:not(.occupied) {
  background: #fdfdf9;
  border-color: #fef08a;
}

.bed-slot.has-reservation:not(.occupied):hover {
  border-color: #fde047;
  box-shadow: 0 4px 14px rgba(202, 138, 4, 0.08);
}

.bed-slot.drag-over {
  background: #eff6ff;
  border-color: #3b82f6;
  border-style: dashed;
  transform: scale(1.01);
}

/* Bed Header: [Pill on left] [Status + Hover Action on right] */
.bed-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 26px;
}

.bed-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.bed-pill i {
  color: #64748b;
  font-size: 0.75rem;
}

.bed-header-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Hover-reveal Ghost Action Toolbar */
.bed-hover-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  transform: translateX(4px);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bed-slot:hover .bed-hover-actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.btn-ghost-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-ghost-icon:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-ghost-icon.btn-danger-ghost:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-ghost-icon.btn-warning-ghost {
  color: #b45309;
  border-color: #fef08a;
  background: #fefce8;
}

.btn-ghost-icon.btn-warning-ghost:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.btn-ghost-icon.schedule-bed-btn {
  flex-shrink: 0;
}

.btn-ghost-checkout {
  height: 24px;
  padding: 0 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #dc2626;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-ghost-checkout:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

/* Bed Status Badges */
.bed-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 0.15rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.bed-status-badge.free {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.bed-status-badge.reserved-free {
  background: #fefce8;
  color: #ca8a04;
  border: 1px solid #fef08a;
}

.bed-status-badge.occupied {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.bed-status-badge.overdue {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  animation: pulse 1.5s infinite;
}

.bed-status-badge.permanent {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

/* Bed Body (Content) */
.bed-slot-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* 空闲床位微卡 (Bed Vacant Card) */
.bed-vacant-card {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 38px;
  transition: all 0.15s ease;
  margin-bottom: 0.25rem;
}

.bed-vacant-card:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.bed-vacant-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #475569;
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bed-vacant-info i {
  color: #16a34a;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.bed-vacant-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* 方案 A：内嵌独立住人微卡 (Bed Resident Card) */
.bed-resident-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.15s ease;
  margin-bottom: 0.25rem;
}

.bed-resident-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.bed-resident-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.bed-resident-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.bed-resident-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.bed-resident-details {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.bed-resident-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 105px;
}

.bed-resident-faname {
  font-size: 0.78rem;
  font-weight: 400;
  color: #64748b;
  white-space: nowrap;
}

.bed-resident-type {
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-resident-checkout {
  height: 24px;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid #fecdd3;
  background: #ffffff;
  color: #e11d48;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-resident-checkout:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
  box-shadow: 0 2px 5px rgba(225, 29, 72, 0.22);
  transform: translateY(-1px);
}

.bed-resident-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  width: 100%;
  cursor: pointer;
}

.bed-resident-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bed-resident-date i {
  font-size: 0.72rem;
  color: #94a3b8;
}

.bed-resident-date.overdue {
  color: #e11d48;
  font-weight: 600;
}

.bed-resident-date.overdue i {
  color: #e11d48;
}

.resident-overdue-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #e11d48;
  background: #ffe4e6;
  border: 1px solid #fecdd3;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Single-line Reservation Strip */
.bed-reservation-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: 6px;
  font-size: 0.76rem;
  color: #92400e;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bed-reservation-strip:hover {
  background: #fef3c7;
  border-color: #fde68a;
  box-shadow: 0 1px 3px rgba(180, 83, 9, 0.1);
}

.bed-reservation-strip i {
  color: #d97706;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.bed-reservation-strip .res-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Room Occupancy Pill in Room Header */
.room-occupancy-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.room-occupancy-pill.free {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.room-occupancy-pill.partial {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.room-occupancy-pill.full {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Clean Add Bed Button */
.room-add-bed-btn {
  width: 100%;
  padding: 0.55rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.room-add-bed-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

/* Modal Windows */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-smooth);
}

.modal-container.modal-lg {
  max-width: 820px;
}

.modal-container.modal-xl {
  max-width: 960px;
  width: 95%;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--text-dark);
}

.modal-close {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  transform: scale(1.08);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  flex-shrink: 0;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-label.required::after {
  content: " *";
  color: var(--status-danger);
}

.form-input,
.form-select,
.form-textarea {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
  background: #ffffff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

/* Dynamic Inbound/Outbound Switcher */
.switch-tabs {
  display: flex;
  background: #edf2f7;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.switch-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}

.switch-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Location Photo Preview */
.photo-gallery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.photo-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

/* QR Modal Graphics */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px dashed var(--primary);
}

.qr-code-img {
  width: 180px;
  height: 180px;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 200;
}

.toast {
  background: #ffffff;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Responsive & Mobile Adaptation
   ========================================================================== */

@media (max-width: 900px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
    z-index: 9500;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  }

  .sidebar.open {
    transform: translateX(260px);
  }

  .topbar {
    padding: 0 1rem;
    height: auto;
    min-height: 60px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .content-wrapper {
    padding: 1rem;
  }

  .kanban-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }

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

  .form-group.full-width {
    grid-column: span 1;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .topbar-left {
    flex: 1;
  }

  .page-header-title {
    font-size: 1.1rem;
  }

  .topbar-actions {
    gap: 0.5rem;
  }

  .topbar-actions .btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }

  .badge-gold {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
  }

  .content-wrapper {
    padding: 0.75rem 0.5rem;
  }

  .dashboard-stats-grid,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card .value {
    font-size: 1.8rem;
  }

  .room-card {
    margin-bottom: 0.5rem;
  }

  /* Table horizontal scroll wrapper for mobile */
  .custom-table-container,
  .table-container,
  .log-table-container,
  .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .custom-table {
    min-width: 580px;
  }

  /* Form actions and filter bars */
  .action-bar,
  .filter-bar,
  .room-actions-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .action-bar input,
  .filter-bar input,
  .action-bar select,
  .filter-bar select {
    width: 100% !important;
    max-width: 100% !important;
  }

  .modal-container {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 0 !important;
    max-height: 92vh !important;
    border-radius: 14px !important;
  }

  .modal-header {
    padding: 0.85rem 1rem !important;
  }

  .modal-title {
    font-size: 1.05rem !important;
  }

  .modal-close {
    width: 30px !important;
    height: 30px !important;
    font-size: 1.1rem !important;
  }

  .modal-body {
    padding: 0.85rem 0.75rem !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 0.75rem 1rem !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer .btn {
    flex: 1;
  }
}

/* ==========================================================================
   v1.2 新增样式
   ========================================================================== */

/* RBAC Permission Control - Hidden Elements */
.perm-hidden {
  display: none !important;
}

.perm-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Custom Alert / Confirm Dialog ── */
.custom-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  animation: fadeInOverlay 0.15s ease;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.custom-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUpDialog 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpDialog {
  from {
    transform: translateY(20px) scale(0.97);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.custom-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 1rem auto;
}

.custom-dialog-icon.alert-info {
  background: var(--status-info-bg);
  color: var(--status-info);
}

.custom-dialog-icon.alert-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.custom-dialog-icon.alert-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.custom-dialog-icon.alert-success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.custom-dialog-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

.custom-dialog-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.custom-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ── Image Upload Component ── */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: #fafbfc;
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-area-icon {
  font-size: 2rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.upload-area-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-area-text strong {
  color: var(--primary);
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(211, 47, 47, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.image-preview-remove:hover {
  background: var(--status-danger);
}

/* ── Roster Tab / Page View Toggle ── */
.view-tabs {
  display: flex;
  background: #edf2f7;
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
  margin-bottom: 5px;
  width: fit-content;
}

.view-tab {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  white-space: nowrap;
}

.view-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ── Person Detail Card in Modal ── */
.person-detail-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.person-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.person-detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.person-detail-value {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}

.person-detail-banner {
  background: linear-gradient(135deg, #1e262c, #3a4750);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.person-detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #e6c667);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-weight: 700;
}

/* ── Operation Log Viewer ── */
.log-table-container {
  max-height: 480px;
  overflow-y: auto;
}

.log-module-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.log-module-dormitory {
  background: #ebf8ff;
  color: #2b6cb0;
}

.log-module-scripture {
  background: rgba(197, 155, 39, 0.15);
  color: #a37c18;
}

.log-module-medicine {
  background: #e8f5e9;
  color: #2e7d32;
}

.log-module-warehouse {
  background: #f3e8ff;
  color: #6b46c1;
}

.log-module-system {
  background: #edf2f7;
  color: #718096;
}

/* ── Role Restricted Notice Banner ── */
.role-restricted-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--status-warning-bg);
  border: 1px solid rgba(237, 108, 2, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--status-warning);
  font-weight: 600;
}

/* ── Quick Room Change Dropdown ── */
.quick-room-select-wrapper {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border-color);
  margin-top: 1rem;
}

.quick-room-select-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.quick-room-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.quick-room-controls .form-select {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 100%;
}
#btn-quick-change-room {
  flex-shrink: 0;
  white-space: nowrap;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 1.1rem;
}
@media (max-width: 540px) {
  .quick-room-controls {
    flex-direction: column;
    align-items: stretch;
  }
  #btn-quick-change-room {
    width: 100%;
  }
}

/* ── Bed CRUD Mini Controls ── */
.bed-crud-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: #f0f4f8;
  border-top: 1px dashed var(--border-color);
  justify-content: flex-end;
}

/* ── Form Section Cards (对齐 apply-dorm 分块卡片风格) ── */
.form-section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.45rem;
}

.form-section-title i {
  color: var(--primary);
  font-size: 0.95rem;
}

.id-notice {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  line-height: 1.4;
}

.id-notice.ok {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
}

.id-notice.err {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
}

/* ── 宿舍一体化控制台 (Dorm Console Card) ── */
.dorm-console-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: box-shadow var(--transition-smooth);
}

.dorm-console-card:hover {
  box-shadow: var(--shadow-md);
}

.dorm-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.dorm-console-header .view-tabs {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.25rem;
  display: inline-flex;
  flex-shrink: 0;
}

.dorm-console-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start; /* 始终居左对齐 */
}

.dorm-console-tip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fdfbf5;
  border: 1px solid rgba(197, 155, 39, 0.22);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  color: #785805;
  line-height: 1.45;
  transition: all var(--transition-normal);
}

.dorm-console-tip i {
  color: var(--primary);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* 响应式断点适配：窗口缩小换行时始终严格居左对齐 */
@media (max-width: 1120px) {
  .dorm-console-header {
    flex-direction: column;
    align-items: flex-start; /* 标题与Tabs居左 */
    gap: 0.85rem;
  }

  .dorm-console-actions {
    justify-content: flex-start; /* 按钮始终居左排布 */
    width: 100%;
  }
}

@media (max-width: 768px) {
  .dorm-console-card {
    padding: 1rem 0.85rem;
  }

  .dorm-console-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* 移动端保持居左流式排布 */
    gap: 0.5rem;
    width: 100%;
  }

  .dorm-console-actions .btn {
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }

  .dorm-console-tip {
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
  }
}

/* ── Room Card Highlight Pulse ── */
@keyframes roomCardPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(197, 155, 39, 0.4);
  }

  50% {
    transform: scale(1.01);
    box-shadow: 0 0 0 6px rgba(197, 155, 39, 0.2);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(197, 155, 39, 0);
  }
}

.room-card.highlight-flash {
  animation: roomCardPulse 1.2s ease-out;
}

/* ── Bed Upcoming Reservation Badge (床位预约折叠徽章) ── */
.bed-reservation-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.2rem 0.5rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 0.74rem;
  color: #1d4ed8;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: fit-content;
  max-width: 100%;
}

.bed-reservation-badge:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.bed-reservation-badge.warning {
  background: #fefce8;
  border-color: #fef08a;
  color: #a16207;
}

.bed-reservation-badge.warning:hover {
  background: #fef9c3;
  border-color: #fde047;
  box-shadow: 0 1px 3px rgba(161, 98, 7, 0.15);
}

.bed-reservation-badge i {
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ── Bed Schedule Modal / Timeline (床位排期时间线弹窗) ── */
.bed-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0;
}

.bed-timeline-item {
  display: flex;
  gap: 0.85rem;
  position: relative;
}

.bed-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 2rem;
  left: 1rem;
  bottom: -0.85rem;
  width: 2px;
  background: #e2e8f0;
}

.bed-timeline-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  z-index: 1;
}

.bed-timeline-icon.current {
  background: #dbeafe;
  color: #2563eb;
  border: 2px solid #3b82f6;
}

.bed-timeline-icon.reserved {
  background: #fef3c7;
  color: #d97706;
  border: 2px solid #f59e0b;
}

.bed-timeline-icon.empty {
  background: #dcfce7;
  color: #16a34a;
  border: 2px solid #22c55e;
}

.bed-timeline-icon.past {
  background: #f1f5f9;
  color: #64748b;
  border: 2px solid #cbd5e1;
}

.bed-timeline-card {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   现代高密度禅意房态盘样式 (PMS Compact Room Rack & Bed Capsules)
   ========================================================================== */

/* 单行高集约房间头部 */
.room-header-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  background: #faf8f5;
  border-bottom: 1px solid #ebe5d8;
  font-size: 0.83rem;
  gap: 0.35rem;
  min-height: 36px;
  box-sizing: border-box;
}

.room-header-title {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.room-header-title .room-door-icon {
  color: #8c7355;
  font-size: 0.8rem;
  opacity: 0.8;
}

.room-header-title .room-num {
  color: #2c251d;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.room-header-title .room-name-alias {
  color: #786b59;
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.room-gender-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.32rem;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s;
}

.room-gender-badge:hover {
  opacity: 0.85;
}

.room-gender-badge.male {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
}

.room-gender-badge.female {
  background: #fff5f7;
  color: #b83280;
  border: 1px solid #fed7e2;
}

.room-gender-badge.mixed {
  background: #faf5ff;
  color: #6b46c1;
  border: 1px solid #e9d8fd;
}

.room-header-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.room-occ-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.06rem 0.4rem;
  border-radius: 10px;
  white-space: nowrap;
}

.room-occ-pill.free {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.room-occ-pill.partial {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.room-occ-pill.full {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.room-occ-pill.empty {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.room-header-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.room-tool-btn {
  background: transparent;
  border: none;
  color: #a89f91;
  padding: 0.12rem 0.22rem;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.room-tool-btn:hover {
  color: #312e81;
  background: #ede9fe;
}

.room-tool-btn.delete-room-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

/* 紧凑房间主体与床组排布 */
.room-body-compact {
  padding: 0.55rem 0.65rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.room-units-flex {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex: 1;
}

.unit-group-column {
  flex: 1 1 110px;
  min-width: 95px;
  background: #fcfbfa;
  border: 1px solid #ece7dc;
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.unit-group-column:hover {
  border-color: #d1c7b7;
}

.unit-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #786b59;
  font-weight: 600;
  margin-bottom: 0.3rem;
  padding: 0 0.1rem;
}

.unit-group-title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.unit-group-title i {
  font-size: 0.65rem;
  opacity: 0.8;
}

/* 自定义上下铺矢量图遮罩图标 (支持自适应 currentColor) */
.icon-bunk-bed {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  background-color: currentColor;
  -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN4AAADICAYAAACH6F8xAAAKOklEQVR4AeydgXbbKBBFyf5Y2y9r82Xd/bIub72cozbBnhFCMHB9PJEswQAX3yKlifNX+v3xI7/8meNXDm31Ou/yhAAEnATkjhz61KUi3tecVIW+56328yZpq9eqqCSJBwQg8JKAvHnpUhFPBVWhllUCPjtfq8dxCOxGwOSSxLOuZpJvN4iMFwIeAmaXJN4XY2ZWPCOoRYoxDD8Bs0sSD6H8gKkBgc8ImF2SeJ8l4BgEINCRAOJ1hEtqCNQIIF6NDMch0JFAcPE6kiE1BDoSQLyOcEkNgRoBxKuR4TgEOhJAvI5wSQ2BGgHEq5HheHACc3cf8eaeH3q3KAHEW3RiGdbcBBBv7vmhd4sSQLxFJ5ZhzU0A8UbOD21vSwDxtp16Bj6SAOKNpE/b2xJAvG2nnoGPJOAVT58ncSb0K/ElzL8sOBIMbUOgJ4GX4v3RuKQ5E/q8lhISt3xymWT8owleQmB9Al7xriRSRJSEkhE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z0pqjXL6h1nfExgdZppRxBNYhXlguSDyZQg85yQQRTzRW3bV0+CIvQhEEk8rnsI6Q1+sBSkHgbsJRBLPy4ZLTS8xyt9GIJp4XG7e9tagoZ4EoonnudTsyY3cEGgiYBWvqZGLKyPfxUBJdz+BiOJ5KHGf56FF2dsIrC7ebSBpCAIeAl7xRv9kgNr3jE//paA6RErRGGjukuMxw/jM3fWKp5+BHB1fzaNLSWVH93f19nuNT3OXjA+V7dUPT15jd1PyimdOTEEIQKBOAPHqbDgDgW4EEK8bWhJDoE4A8epsOAOBbgQ2Ea8bPxJD4BQBxDuFjUoQaCOAeG38qA2BUwQQ7xQ2KkGgjQDitfGjdngCYwaAeGO40+rmBBBv8zcAwx9DAPHGcKfVzQkg3uZvAIY/hgDijeHua5XSyxFAvOWmlAFFIIB4EWaJPi5HAPGWm1IGFIEA4kWYJfq4HIHLxFuODAOCQEcCiNcRLqkhUCPgFU8fJkukBAMYfPYeSNaHV7xvOTGREgxg8Nl7IOthe3rFs2WlFAQOBNj9SADxPjLhCAS6E0C87ohpAAIfCSDeRyYcgUB3AojXHTENQOAjAcR7MOErBG4lgHi34qYxCDwIIN6DA18hcCsBxLsVN41B4EEA8R4c+AqBGoEuxxGvC1aSQuA5AcR7zoezEOhCAPG6YCUpBJ4TQLznfDgLgS4EEK8L1ruT0l40AogXbcbo7xIEJJ5+k3aJwTAICAwmYHZJ4v1j7Oy7sRzFILArAbNLEu9HpmQxVeVyUZ4QgECFgBwxuSTxlOPVaqbPl1C580FNCOxB4JVL/50v4snSt8xFB7Wfd5O2Ch3XNvGAAAReEpArcqbmklbF9C8AAAD//5WC5HoAAAAGSURBVAMAtmNhRb664KgAAAAASUVORK5CYII=');
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN4AAADICAYAAACH6F8xAAAKOklEQVR4AeydgXbbKBBFyf5Y2y9r82Xd/bIub72coz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IIN6DA18hcCsBxLsVN41B4EEA8R4c+AqBGoEuxxGvC1aSQuA5AcR7zoezEOhCAPG6YCUpBJ4TQLznfDgLgS4EEK8L1ruT0l40AogXbcbo7xIEJJ5+k3aJwTAICAwmYHZJ4v1j7Oy7sRzFILArAbNLEu9HpmQxVeVyUZ4QgECFgBwxuSTxlOPVaqbPl1C580FNCOxB4JVL/50v4snSt8xFB7Wfd5O2Ch3XNvGAAAReEpArcqbmklbF9C8AAAD//5WC5HoAAAAGSURBVAMAtmNhRb664KgAAAAASUVORK5CYII=');
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

@supports not (mask-image: url('')) {
  .icon-bunk-bed {
    background: url('../images/bunk-bed.png') no-repeat center / contain;
  }
}

.unit-group-title .icon-bunk-bed {
  width: 14px;
  height: 13px;
  opacity: 0.85;
}

.unit-group-header .btn-del-unit {
  background: transparent;
  border: none;
  color: #c4b9a9;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0 0.15rem;
  border-radius: 3px;
  transition: all 0.15s;
}

.unit-group-header .btn-del-unit:hover {
  color: #dc2626;
  background: #fee2e2;
}

.unit-capsules-stack {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  justify-content: center;
}

/* 铺位微胶囊：高密度核心元素 */
.bed-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 0.45rem;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid #dcd6c8;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
  box-sizing: border-box;
  gap: 0.25rem;
}

.bed-capsule:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.capsule-slot-tag {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.05rem 0.22rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.capsule-name-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.capsule-status-icon {
  font-size: 0.68rem;
  flex-shrink: 0;
}

.capsule-status-icon.gold {
  color: #d97706;
}

.capsule-status-icon.red {
  color: #dc2626;
}

/* 空床胶囊 */
.bed-capsule.vacant {
  border: 1px dashed #cbd5e1;
  background: #ffffff;
}

.bed-capsule.vacant .capsule-name-text {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.bed-capsule.vacant:hover {
  border-color: #c59b27;
  background: #fefdf8;
}

.bed-capsule.vacant:hover .capsule-name-text {
  color: #b45309;
  font-weight: 600;
}

/* 在住胶囊 */
.bed-capsule.occupied {
  border-color: #bbf7d0;
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
}

.bed-capsule.occupied:hover {
  border-color: #86efac;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

/* 常住金色 */
.bed-capsule.occupied.permanent {
  border-color: #fde68a;
  background: #fefce8;
  border-left: 3px solid #d97706;
}

.bed-capsule.occupied.permanent:hover {
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

/* 超期红色告警 */
.bed-capsule.occupied.overdue {
  border-color: #fecaca;
  background: #fef2f2;
  border-left: 3px solid #dc2626;
}

.bed-capsule.occupied.overdue:hover {
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* 智能悬浮名片 Tooltip */
.bed-capsule-tooltip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e293b;
  color: #ffffff;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  font-size: 0.74rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1050;
  line-height: 1.45;
  min-width: 175px;
}

.bed-capsule-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.bed-capsule:hover .bed-capsule-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.25rem;
}

.tooltip-name {
  font-size: 0.84rem;
  color: #f8fafc;
  font-weight: 700;
}

.tooltip-sub {
  color: #94a3b8;
  font-size: 0.72rem;
}

.tooltip-type-tag {
  background: #334155;
  color: #cbd5e1;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  font-size: 0.66rem;
}

.tooltip-badge-gold {
  color: #fde047;
  font-size: 0.7rem;
  font-weight: 700;
}

.tooltip-badge-red {
  color: #f87171;
  font-size: 0.7rem;
  font-weight: 700;
}

.tooltip-divider {
  height: 1px;
  background: #334155;
  margin: 0.25rem 0;
}

.tooltip-row {
  color: #cbd5e1;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tooltip-row i {
  width: 11px;
  color: #94a3b8;
}

/* 拖拽交互样式 */
.bed-capsule[draggable="true"] {
  cursor: grab;
}

.bed-capsule[draggable="true"]:active {
  cursor: grabbing;
}

.bed-capsule.dragging {
  opacity: 0.35;
  border-style: dashed;
}

.bed-capsule.drag-over {
  border-color: #3b82f6 !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 2px #3b82f6 !important;
}

/* 空房间紧凑形态 */
.room-empty-compact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #a89f91;
  font-size: 0.78rem;
  flex: 1;
  min-height: 60px;
  background: #faf8f5;
  border: 1px dashed #e2dad0;
  border-radius: 6px;
}

.room-empty-compact i {
  font-size: 1.1rem;
  opacity: 0.4;
}

.room-empty-add-btn {
  border: none;
  background: #ece4d7;
  color: #635342;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  cursor: pointer;
  margin-left: 0.2rem;
  transition: background 0.15s;
}

.room-empty-add-btn:hover {
  background: #c59b27;
  color: #ffffff;
}

/* 双联快速登记与扫码入住弹窗布局 */
/* 双联快速登记与扫码入住弹窗布局 */
.checkin-modal-container {
  display: grid;
  grid-template-columns: 1fr 20px 290px;
  gap: 1.5rem;
  align-items: start;
  padding: 0.25rem 0;
  width: 100%;
  box-sizing: border-box;
}

.checkin-mobile-nav {
  display: none;
  background: #f5efe3;
  border: 1px solid #ebd9a2;
  border-radius: 10px;
  padding: 4px;
  gap: 6px;
  margin-bottom: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.checkin-tab-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #78664f;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  user-select: none;
}

.checkin-tab-btn.active {
  background: #ffffff;
  color: #92400e;
  box-shadow: 0 2px 6px rgba(146, 64, 14, 0.12);
}

.checkin-modal-header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.checkin-title-text {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.checkin-title-room-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #92400e;
}

.checkin-title-arrow {
  color: #9ca3af;
  font-size: 0.85rem;
}

.checkin-title-bed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border: 1px solid #8b5cf6;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4c1d95;
}

.checkin-title-bed-type {
  font-weight: 400;
  font-size: 0.78rem;
  color: #6d28d9;
}

.checkin-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.checkin-grid-2col:last-child {
  margin-bottom: 0;
}

.checkin-panel {
  display: flex;
  flex-direction: column;
}

.checkin-panel-form {
  max-height: 74vh;
  overflow-y: auto;
  padding-right: 0.6rem;
  width: 100%;
  box-sizing: border-box;
}

.checkin-form-section {
  background: #fdfcf9;
  border: 1px solid #ebd9a2;
  border-radius: 9px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.checkin-form-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #5c430e;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px dashed #ebd9a2;
  padding-bottom: 0.35rem;
}

.checkin-panel-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: #3f2e18;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ebd9a2;
  flex-wrap: wrap;
}

.checkin-modal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
  min-height: 380px;
}

.checkin-modal-divider::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #ebd9a2;
}

.checkin-modal-divider span {
  position: relative;
  z-index: 1;
  background: #ffffff;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  color: #92400e;
  font-weight: 600;
  border: 1px solid #ebd9a2;
  border-radius: 50%;
}

.checkin-panel-qr {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fbf9f4;
  border: 1px solid #ebd9a2;
  border-radius: 12px;
  padding: 1.5rem 1.1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  width: 100%;
  box-sizing: border-box;
}

.checkin-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.checkin-qr-code {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ebd9a2;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  width: 204px;
  height: 204px;
}

.checkin-qr-bed-badge {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #4b3917;
  background: #fef9ed;
  border: 1px solid #ebd9a2;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
}

.checkin-qr-tip {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 0.6rem;
}

.checkin-scan-status-pill {
  margin-top: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 768px) {
  .checkin-modal-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    width: 100%;
  }

  .checkin-mobile-nav {
    display: flex !important;
  }

  .checkin-modal-divider {
    display: none !important;
  }

  .checkin-panel.mobile-panel-hidden {
    display: none !important;
  }

  .checkin-panel-form {
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
    width: 100%;
  }

  .checkin-panel-header {
    font-size: 0.88rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.4rem;
  }

  .checkin-form-section {
    padding: 0.75rem 0.75rem;
    margin-bottom: 0.65rem;
    border-radius: 8px;
    width: 100%;
  }

  .checkin-form-section-title {
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
  }

  .checkin-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
    margin-bottom: 0.6rem !important;
  }

  .checkin-panel-qr {
    position: static !important;
    padding: 1.25rem 0.85rem !important;
    width: 100% !important;
  }

  .checkin-qr-code {
    width: 180px !important;
    height: 180px !important;
  }

  .checkin-modal-header-title {
    font-size: 0.95rem;
    gap: 0.35rem;
  }

  .checkin-title-room-badge,
  .checkin-title-bed-badge {
    font-size: 0.78rem;
    padding: 0.12rem 0.4rem;
  }
}

@media (min-width: 769px) {
  .checkin-mobile-nav {
    display: none !important;
  }
  .checkin-panel.mobile-panel-hidden {
    display: flex !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   茱萸ZhuYu — 专属定制日历选择器 (ZhuYuDatePicker) 样式
   ══════════════════════════════════════════════════════════════════ */
.zy-datepicker-input {
  cursor: pointer !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='%23c59b27' d='M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L48 64C21.5 64 0 85.5 0 112l0 32 448 0 0-32c0-26.5-21.5-48-48-48l-56 0 0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40L152 64l0-40zM448 192L0 192l0 256c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-256z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 15px 15px !important;
  padding-right: 34px !important;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.02em;
}

.zy-datepicker-input:hover {
  border-color: #c59b27 !important;
}

.zy-datepicker-popup {
  position: absolute;
  z-index: 100000;
  display: none;
  width: 296px;
  background: #ffffff;
  border: 1px solid #e7dfd1;
  border-radius: 12px;
  box-shadow: 0 12px 30px -4px rgba(44, 37, 29, 0.16), 0 6px 12px -4px rgba(44, 37, 29, 0.08);
  padding: 0.8rem;
  font-family: inherit;
  user-select: none;
  animation: zyDpFadeIn 0.18s ease-out;
}

@keyframes zyDpFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.zy-dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.zy-dp-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c251d;
}

.zy-dp-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  color: #786b59;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.zy-dp-btn:hover {
  background: #fbf6ec;
  color: #c59b27;
}

.zy-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8c7e6c;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #f3ede2;
}

.zy-dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 0.65rem;
}

.zy-dp-cell {
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #2c251d;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.zy-dp-cell:hover:not(.zy-dp-disabled) {
  background: #fdf8ef;
  color: #c59b27;
  font-weight: 700;
}

.zy-dp-cell.zy-dp-today {
  border: 1.5px solid #c59b27;
  color: #c59b27;
  font-weight: 700;
}

.zy-dp-cell.zy-dp-selected {
  background: #c59b27 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(197, 155, 39, 0.35);
}

.zy-dp-cell.zy-dp-other-month {
  color: #d1c7b7;
}

.zy-dp-cell.zy-dp-disabled {
  color: #e5ded3;
  cursor: not-allowed;
  background: transparent !important;
  text-decoration: line-through;
}

.zy-dp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.55rem;
  border-top: 1px solid #f3ede2;
  gap: 0.45rem;
}

.zy-dp-footer-btn {
  flex: 1;
  padding: 0.38rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #e7dfd1;
  background: #faf8f5;
  color: #6b6357;
  transition: all 0.15s ease;
}

.zy-dp-footer-btn:hover {
  background: #f4ede0;
  color: #2c251d;
}

.zy-dp-btn-today {
  border-color: #ebd9a2;
  background: #fefcf7;
  color: #927318;
}

.zy-dp-btn-today:hover {
  background: #fcf4de;
  color: #785a08;
}

.zy-dp-btn-close {
  background: #c59b27;
  color: #ffffff;
  border-color: #c59b27;
}

.zy-dp-btn-close:hover {
  background: #a37c16;
  border-color: #a37c16;
  color: #ffffff;
}