.departments-container {
  padding: 24px;
  background: #f5f5f5;
  min-height: 100vh;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;

  h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
  }

  .subtitle {
    color: #666;
    margin: 0;
  }

  .header-right {
    display: flex;
    gap: 12px;
  }
}

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

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;

  .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
  }

  .stat-value {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  .stat-label {
    color: #666;
    font-size: 14px;
  }
}

.filter-bar {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .search-input {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
  }
}

.loading-state {
  background: white;
  border-radius: 8px;
  padding: 60px;
  text-align: center;
}

.data-table {
  background: white;
  border-radius: 8px;
  overflow: hidden;

  table {
    width: 100%;
    border-collapse: collapse;

    th,
    td {
      padding: 12px 16px;
      text-align: left;
      border-bottom: 1px solid #f0f0f0;
    }

    th {
      background: #fafafa;
      font-weight: 600;
      font-size: 14px;
      color: #333;
    }

    td {
      font-size: 14px;
      color: #666;
    }

    tr:last-child td {
      border-bottom: none;
    }

    .empty-state {
      text-align: center;
      padding: 60px;
      color: #999;
    }
  }
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: none;
  border: none;
  color: #165DFF;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;

  &:hover {
    background: #E6F7FF;
  }

  &.btn-danger {
    color: #F53F3F;

    &:hover {
      background: #FFECE8;
    }
  }
}

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;

  &.btn-primary {
    background: #165DFF;
    color: white;

    &:hover {
      background: #0E4DCC;
    }
  }

  &.btn-secondary {
    background: white;
    border: 1px solid #ddd;
    color: #333;

    &:hover {
      background: #f5f5f5;
    }
  }

  &.btn-default {
    background: white;
    border: 1px solid #ddd;
    color: #333;
  }

  &.btn-text {
    background: none;
    color: #165DFF;
  }
}

// 侧边面板样式
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 1000;

  &.open {
    pointer-events: auto;

    .panel-overlay {
      opacity: 1;
    }

    .panel-content {
      transform: translateX(0);
    }
  }

  .panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
  }

  .panel-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    background: white;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s;
  }

  .panel-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;

    h2 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
    }

    .btn-close {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: #666;
      padding: 0;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;

      &:hover {
        background: #f5f5f5;
      }
    }
  }

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

  .panel-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }
}

.form-group {
  margin-bottom: 20px;

  label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;

    &.required::after {
      content: '*';
      color: #F53F3F;
      margin-left: 4px;
    }
  }

  .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;

    &:focus {
      outline: none;
      border-color: #165DFF;
    }
  }
}

.detail-item {
  margin-bottom: 20px;

  label {
    display: block;
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
  }

  .detail-value {
    font-size: 16px;
    color: #333;
  }
}
