/* 暂无数据和错误状态样式 */
.no-data-container, .error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: 2rem 0;
}

.no-data-icon, .error-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.no-data-icon {
  color: var(--gray-color);
}

.error-icon {
  color: var(--danger-color);
}

.no-data-container h3, .error-container h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--dark-color);
}

.no-data-container p, .error-container p {
  margin-bottom: 2rem;
  color: var(--gray-color);
  max-width: 500px;
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: 2rem 0;
}

.loading-container p {
  font-size: 1.2rem;
  color: var(--gray-color);
}

/* 通知容器样式 */
.notification-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 1050;
  min-width: 300px;
}

/* 加载动画样式 */
.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1040;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 图表容器中的暂无数据样式 */
.chart-container .no-data, .chart-container .loading, .chart-container .error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--gray-color);
  font-style: italic;
}

#healthOverviewContainer .chart-container {
    height: 300px;
}

#vitalSignsMiniChart {
    height: 300px !important;
}



.chart-container .error {
  color: var(--danger-color);
}

/* 全局变量 */
:root {
  --primary-color: #165DFF;
  --secondary-color: #FF7D00;
  --success-color: #00B42A;
  --warning-color: #FF7D00;
  --danger-color: #F53F3F;
  --info-color: #165DFF;
  --light-color: #F2F3F5;
  --dark-color: #1D2129;
  --gray-color: #86909C;
  --border-color: #E5E6EB;
  --background-color: #F2F3F5;
  --sidebar-bg: #2C3E50; /* 添加侧边栏背景色变量 */
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';
  --font-size-base: 14px;
  --font-size-large: 16px;
  --font-size-small: 12px;
  
  --border-radius: 6px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition-base: all 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: var(--background-color);
  color: var(--dark-color);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: var(--transition-base);
}

a:hover {
  color: #0a42d4;
}

/* 顶部导航栏 */
.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0 1.5rem;
  height: 60px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.navbar-left {
  display: flex;
  align-items: center;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 1rem;
  color: var(--primary-color);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.notification-icon {
  position: relative;
  cursor: pointer;
}

.notification-icon .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--danger-color);
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.logout-btn {
  background-color: var(--danger-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}

.logout-btn:hover {
  background-color: #c82333;
}

/* 容器 */
.container {
  display: flex;
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: white;
  height: 100%;
  position: fixed;
  top: 60px;
  left: 0;
  overflow-y: auto;
  transition: all 0.3s;
  z-index: 999;
  font-size: 16px; /* 增大侧边栏字体 */
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 60px;
  margin-top: 80px; /* 为顶部固定导航栏留出空间 */
}

.nav-menu ul {
  list-style: none;
  padding: 0;
}

.nav-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item:last-child {
  border-bottom: none;
}

.nav-item a {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: white;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-item a:hover,
.nav-item.active a {
  background-color: rgba(22, 93, 255, 0.3);
}

.nav-item .icon {
  margin-right: 1rem;
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.sidebar.collapsed .nav-item .icon {
  margin-right: 0;
}

.sidebar.collapsed .nav-item .text {
  display: none;
}

.sidebar.collapsed .nav-item a {
  justify-content: center;
  padding: 1rem;
  font-size: 14px; /* 折叠时使用稍小的字体 */
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 20px;
  background-color: #f5f7fa;
  margin-left: 250px; /* 与侧边栏宽度相同，避免内容被遮挡 */
  margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  transition: margin-left 0.3s ease;
  max-width: calc(100% - 250px); /* 确保内容区不会超出屏幕 */
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-header h2 {
  font-size: 24px;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #0a4ae0;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: #f0f0f0;
  color: #333;
}

/* 操作按钮样式 */
.action-btn {
  cursor: pointer;
  border: none;
  background: none;
  padding: 6px 10px;
  margin: 0 2px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  /* 确保文字可见性 */
  color: inherit;
  min-width: 45px;
}

.action-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* 为不同操作类型的按钮设置不同颜色 */
.action-btn[data-action="view"] {
  color: #007bff;
}

.action-btn[data-action="edit"] {
  color: #007bff;
}

.action-btn[data-action="delete"] {
  color: #dc3545;
  border: 1px solid #dc3545;
}

.action-btn[data-action="view"]:hover {
  background-color: #e3f2fd;
  color: #0056b3;
}

.action-btn[data-action="edit"]:hover {
  background-color: #e3f2fd;
  color: #0056b3;
}

.action-btn[data-action="delete"]:hover {
  background-color: #dc3545;
  color: white;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background-color: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  margin: 0;
  font-size: 18px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* 仪表盘网格布局 */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.grid-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-grid .card {
  margin-bottom: 0;
}

/* 关键指标卡片 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.metric-card {
  display: flex;
  align-items: center;
  padding: 20px;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: transform 0.3s, box-shadow 0.3s;
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin-right: 15px;
}

.bg-primary {
  background-color: var(--primary-color);
}

.bg-success {
  background-color: var(--success-color);
}

.bg-warning {
  background-color: var(--warning-color);
}

.bg-danger {
  background-color: var(--danger-color);
}

.bg-info {
  background-color: var(--info-color);
}

.bg-secondary {
  background-color: var(--secondary-color);
}

.metric-info {
  flex: 1;
}

.metric-value {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.metric-label {
  font-size: 14px;
  color: #666;
}

/* 模态框样式优化 */
.modal-dialog {
  max-width: 800px; /* 设置模态框最大宽度 */
  margin: 1.75rem auto;
}

.modal-content {
  border: none;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-radius: 8px 8px 0 0 !important;
  padding: 1rem 1.5rem;
}

.modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 8px 8px !important;
  padding: 1rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

/* 在小屏幕上调整模态框 */
@media (max-width: 768px) {
  .modal-dialog {
    max-width: calc(100% - 20px);
    margin: 10px auto;
  }
  
  .modal-body .row .col-md-6,
  .modal-body .row .col-md-4,
  .modal-body .row .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* 中等屏幕上的模态框调整 */
@media (min-width: 769px) and (max-width: 1200px) {
  .modal-dialog {
    max-width: 700px;
  }
  
  .sidebar {
    width: 200px;
  }
  
  .sidebar.collapsed {
    width: 60px;
  }
  
  .sidebar.collapsed ~ .main-content {
    margin-left: 60px;
  }
  
  .sidebar:not(.collapsed) ~ .main-content {
    margin-left: 200px;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
  
  .nav-item a {
    padding: 0.8rem 1rem;
    font-size: 14px;
  }
  
  .nav-item .icon {
    margin-right: 0.5rem;
  }
  
  .page-header h2 {
    font-size: 20px;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  .form-row {
    gap: 15px;
  }
  
  .main-content {
    padding: 15px;
    max-width: 100%;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
}

/* 大屏幕上的模态框调整 */
@media (min-width: 1201px) {
  .modal-dialog {
    max-width: 800px;
  }
  
  .container {
    max-width: 100%;
    margin: 0 auto;
  }
  
  .sidebar {
    width: 250px;
  }
  
  .sidebar.collapsed {
    width: 60px;
  }
  
  .sidebar.collapsed ~ .main-content {
    margin-left: 60px;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
  
  .sidebar:not(.collapsed) ~ .main-content {
    margin-left: 250px;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
  
  .page-header h2 {
    font-size: 28px;
  }
  
  .metric-card {
    padding: 25px;
  }
  
  .metric-value {
    font-size: 2rem;
  }
  
  .metric-label {
    font-size: 1rem;
  }
  
  .main-content {
    padding: 25px;
    max-width: 100%;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
}

.metric-trend {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.metric-trend.positive {
  color: var(--success-color);
}

.metric-trend.negative {
  color: var(--danger-color);
}

.metric-trend.neutral {
  color: #666;
}

/* 服务动态 */
.service-updates {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.update-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.update-item:hover {
  background-color: #f8f9fa;
}

.update-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.update-content {
  flex: 1;
}

.update-title {
  font-size: 14px;
  margin-bottom: 5px;
}

.update-title .user {
  font-weight: 600;
  color: var(--primary-color);
}

.update-title .service {
  color: #666;
}

.update-time {
  font-size: 12px;
  color: #999;
}

.update-status {
  font-size: 20px;
}

.status-completed {
  color: var(--success-color);
}

.status-in-progress {
  color: var(--warning-color);
}

.status-pending {
  color: var(--info-color);
}

/* 今日排班 */
.schedule-view {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.schedule-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  background-color: #f8f9fa;
  transition: background-color 0.3s;
}

.schedule-item:hover {
  background-color: #e9ecef;
}

.schedule-item .time {
  font-weight: 600;
  color: #333;
  width: 100px;
  margin-right: 15px;
}

.staff {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.staff-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.staff-info .staff-name {
  font-weight: 500;
  color: #333;
}

.staff-info .staff-role {
  font-size: 12px;
  color: #666;
}

.count {
  font-weight: 600;
  color: var(--primary-color);
}

/* 快速入口 */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
}

.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 15px;
  text-decoration: none;
  color: #333;
  border-radius: 8px;
  transition: all 0.3s;
}

.quick-link:hover {
  background-color: #f8f9fa;
  transform: translateY(-3px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.quick-link-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.quick-link span {
  font-size: 14px;
  text-align: center;
}

/* 登录页面 */
.login-page {
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

.login-container {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.login-header {
  text-align: center;
  padding: 30px 20px 20px;
  background: linear-gradient(135deg, #165DFF 0%, #00a0ff 100%);
  color: white;
}

.login-header .logo {
  font-size: 48px;
  margin-bottom: 10px;
}

.login-header h1 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 500;
}

.login-header p {
  margin: 0;
  opacity: 0.9;
}

.login-form {
  padding: 20px;
}

.login-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}

.login-tabs .tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  border-bottom: 2px solid transparent;
}

.login-tabs .tab.active {
  color: #165DFF;
  border-bottom-color: #165DFF;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
}

.input-with-icon input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.input-with-icon input:focus {
  outline: none;
  border-color: #165DFF;
  box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
}

.verification-input .send-code-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #165DFF;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}

.verification-input .send-code-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.checkbox input {
  margin-right: 8px;
}

.forgot-password {
  color: #165DFF;
  text-decoration: none;
  font-size: 14px;
}

.forgot-password:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

.login-footer a {
  color: #165DFF;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-footer-info {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: white;
  z-index: 1;
}

.login-footer-info p {
  margin: 5px 0;
  font-size: 14px;
  opacity: 0.8;
}

.login-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.background-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.background-slide.active {
  opacity: 1;
}

/* 照护服务页面 */
.calendar-container {
  margin-bottom: 30px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.care-calendar-grid {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

.calendar-day-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #f8f9fa;
  font-weight: bold;
  text-align: center;
}

.calendar-day-header > div {
  padding: 12px;
  border-right: 1px solid #eee;
}

.calendar-day-header > div:last-child {
  border-right: none;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  min-height: 80px;
  padding: 8px;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:nth-last-child(-n+7) {
  border-bottom: none;
}

.calendar-day:hover {
  background-color: #f0f7ff;
}

.calendar-day.disabled {
  color: #ccc;
  background-color: #f9f9f9;
  cursor: not-allowed;
}

/* 记录指示器样式 */
.record-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 10px;
  color: #4e73df;
  background-color: rgba(78, 115, 223, 0.1);
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding-top: 10px;
}

.task-list h4 {
  grid-column: 1 / -1;
  margin-top: 0;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.task-list .no-tasks {
  grid-column: 1 / -1;
}

.task-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #eaecf0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.task-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #e2e8f0;
  transition: background-color 0.3s;
}

.task-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  border-color: #d0d7de;
  z-index: 2;
}

.task-item:hover::before {
  background-color: var(--primary-color);
}

/* 响应式断点调整 */
@media (max-width: 1400px) {
  .task-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .task-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 850px) {
  .task-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 550px) {
  .task-list {
    grid-template-columns: 1fr;
  }
}

/* 移除原来的 last-child margin 处理，因为是 Grid */
.task-item:last-child {
  margin-bottom: 0;
}

/* 优化卡片内部文本样式 */
.task-card-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.task-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d2129;
  line-height: 1.4;
  word-break: break-all;
}

.task-card-body {
  flex: 1;
  font-size: 13px;
  color: #4e5969;
  margin-top: 10px;
}

.task-meta-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta-row i {
  width: 18px;
  margin-right: 6px;
  color: #86909c;
  flex-shrink: 0;
}

.task-status-btn {
  margin-top: 12px;
  width: 100%;
  text-align: center;
  padding: 6px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.task-info .task-time {
  font-size: 14px;
  color: #666;
}

.task-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.status-in-progress {
  background-color: #cce5ff;
  color: #004085;
}

.status-completed {
  background-color: #d4edda;
  color: #155724;
}

.care-record-form .form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.care-record-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.record-section {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  background-color: #fafafa;
}

.record-section h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 30px;
}

/* 表单 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #495057;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-family: inherit;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control::placeholder {
  color: #6c757d;
  opacity: 1;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* 必填字段标识 */
.form-label.required::after {
  content: " *";
  color: var(--danger-color);
}

/* 模态框动画效果 */
.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: translate(0, 0);
}

/* 卡片悬停效果 */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 表格 */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

table tbody tr:hover {
  background-color: #f8f9fa;
}

.status-tag {
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-active {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.status-inactive {
  background-color: rgba(255, 125, 0, 0.1);
  color: var(--warning-color);
}

.status-resigned {
  background-color: rgba(108, 117, 125, 0.1);
  color: var(--gray-color);
}

.status-pending {
  background-color: rgba(255, 193, 7, 0.1);
  color: var(--warning-color);
}

.status-out {
  background-color: rgba(255, 159, 64, 0.1);
  color: #ff9f40;
}

.status-medical {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.status-vacation {
  background-color: rgba(23, 162, 184, 0.1);
  color: #17a2b8;
}

.status-discharged {
  background-color: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

/* 搜索筛选 */
.search-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-filter input,
.search-filter select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-family: inherit;
  position: relative;
  z-index: 1000; /* 确保下拉菜单在侧边栏之上 */
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* 标签页 */
.tab-container {
  background-color: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8f9fa;
}

.tab {
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  border-bottom: 3px solid transparent;
}

.tab.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.tab-content {
  padding: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }
  
  .sidebar:not(.collapsed) {
    width: 250px;
    overflow: auto;
  }
  
  .sidebar.collapsed ~ .main-content {
    margin-left: 60px;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
  
  .sidebar:not(.collapsed) ~ .main-content {
    margin-left: 250px;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
  
  .nav-item .text {
    display: none;
  }
  
  .sidebar:not(.collapsed) .nav-item .text {
    display: inline;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .form-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .form-group {
    width: 100%;
  }
  
  .main-content {
    padding: 10px;
    margin-top: 80px; /* 为顶部固定导航栏留出空间 */
  }
}

/* 紧急联系人标题样式 */
.emergency-contact-title {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
  color: #495057;
  font-size: 1.1rem;
  font-weight: 600;
}

/* 紧急联系人项目样式 */
.emergency-contact-item {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

.emergency-contact-item .info-group {
  margin-bottom: 0.25rem;
}

/* 紧急联系人表单组样式 */
.emergency-contact-group {
  transition: all 0.3s ease;
}

.emergency-contact-group:hover {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 添加联系人按钮样式 */
#addEmergencyContactBtn {
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
}

/* 删除联系人按钮样式 */
.remove-contact-btn {
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.remove-contact-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.no-emergency-contacts {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* 身份证照片显示样式 */
.id-card-title {
  margin-top: 20px;
  margin-bottom: 15px;
  font-size: 1.1em;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.id-card-images {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.id-card-image-container {
  flex: 1;
}

.id-card-image-container label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.id-card-preview {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  text-align: center;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.id-card-preview:hover {
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.id-card-preview img {
  max-width: 100%;
  max-height: 130px;
  object-fit: contain;
}

.placeholder {
  color: #999;
  font-style: italic;
}

/* 模态框基础样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1050; /* 提高z-index确保在搜索框之上 */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.modal.show {
  display: block;
}

.modal-dialog {
  max-width: 800px;
  margin: 1.75rem auto;
}

.modal-content {
  border: none;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  background-color: #fff;
}

.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  border-radius: 10px 10px 0 0 !important;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 10px 10px !important;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* 右下角关闭按钮 */
.modal-footer .btn-close-bottom {
  align-self: flex-end;
}

.info-group {
  margin-bottom: 15px;
  display: flex;
  align-items: flex-start;
}

.info-group label {
  font-weight: 600;
  display: inline-block;
  width: 120px;
  margin-right: 15px;
  color: #555;
  flex-shrink: 0;
}

.info-group span {
  display: inline-block;
  color: #333;
  flex: 1;
  word-break: break-word;
}

.btn-close {
  background: none;
  border: 2px solid var(--danger-color);
  font-size: 24px;
  cursor: pointer;
  color: var(--danger-color);
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close:hover {
  color: #fff;
  background-color: var(--danger-color);
  border-radius: 50%;
}

/* 在小屏幕上调整模态框 */
@media (max-width: 768px) {
  .modal-dialog {
    max-width: calc(100% - 20px);
    margin: 10px auto;
  }
  
  .modal-body .row .col-md-6,
  .modal-body .row .col-md-4,
  .modal-body .row .col-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .info-group {
    flex-direction: column;
  }
  
  .info-group label {
    width: 100%;
    margin-bottom: 5px;
  }
}

/* 中等屏幕上的模态框调整 */
@media (min-width: 769px) and (max-width: 1200px) {
  .modal-dialog {
    max-width: 700px;
  }
}

/* 大屏幕上的模态框调整 */
@media (min-width: 1201px) {
  .modal-dialog {
    max-width: 800px;
  }
}

/* 全局标签页功能 CSS */
.tab-container > .tab-content, .login-form > .tab-content {
  display: none;
}
.tab-container > .tab-content.active, .login-form > .tab-content.active {
  display: block;
}

/* --- 新增的分页样式 --- */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
}

.pagination {
  display: flex;
  gap: 0.5rem;
}

.pagination .page-item {
  border: 1px solid var(--border-color);
  background-color: #fff;
  color: var(--primary-color);
  padding: 6px 12px !important;
  font-size: 13px !important;
  cursor: pointer;
  border-radius: 4px; /* Slightly tighter radius */
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: auto; /* Remove fixed height constraint */
  line-height: 1.5;
  white-space: nowrap; /* Prevent text wrap */
}

.pagination .page-item:hover {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.pagination .page-item.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  cursor: default;
}

.pagination .page-item:disabled {
  background-color: var(--light-color);
  color: var(--gray-color);
  border-color: var(--border-color);
  cursor: not-allowed;
}

/* Remove padding from list item to allow link to fill the area */
.pagination li.page-item {
  padding: 0 !important;
  overflow: hidden; /* Ensure rounded corners */
}

/* page-link override inside .pagination .page-item */
.pagination .page-item .page-link {
    padding: 6px 12px !important;
    border: none !important;
    background: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 新增的每页显示数量选择器样式 */
.page-size-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto; /* 移动到右侧 */
}

/* =================================== */
/* ======== 排班管理日历样式 ========= */
/* =================================== */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #dee2e6;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: hidden;
}

.calendar-header {
    background-color: #f8f9fa;
    padding: 0.5rem;
    font-weight: bold;
    text-align: center;
}

.calendar-day {
    background-color: #fff;
    min-height: 120px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.day-number {
    font-weight: bold;
    margin-bottom: 0.25rem;
    text-align: right;
    color: #6c757d;
}

.schedules-container {
    flex-grow: 1;
}

.schedule-item-compact {
    background-color: #e3f2fd;
    border: 1px solid #bde0fe;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.schedule-item-compact:hover {
   background-color: #cce5ff;
}
.schedule-item-compact .compact-actions {
    display: none;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.schedule-item-compact:hover .compact-actions {
    display: block;
}
.schedule-item-compact .compact-actions i {
    margin-left: 5px;
}
.no-schedule {
    text-align: center;
    color: #adb5bd;
    font-size: 0.9rem;
    padding-top: 1rem;
}

/* =================================== */
/* ======== 通知 (Toast) 样式 ======== */
/* =================================== */
.notification-toast {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin-bottom: 1rem;
    border-left: 5px solid;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: translateX(100%);
    opacity: 0;
    min-width: 320px;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    line-height: 1;
}

.toast-body {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.toast-close {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    opacity: 0.7;
}
.toast-close:hover {
    opacity: 1;
}

/* Success Toast */
.notification-toast.toast-success {
    border-left-color: var(--success-color);
}
.notification-toast.toast-success .toast-icon {
    color: var(--success-color);
}

/* Error Toast */
.notification-toast.toast-error {
    border-left-color: var(--danger-color);
}
.notification-toast.toast-error .toast-icon {
    color: var(--danger-color);
}

/* Modal z-index fix */
.modal-backdrop {
  z-index: 1050 !important;
}

.modal {
  z-index: 1055 !important;
}

#imagePreviewModal {
  z-index: 1060 !important;
}

#imagePreviewModal .modal-backdrop {
  z-index: 1059 !important;
}
