/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import Select2 base styles */
@import url('https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css');

/* Select2 Bootstrap 风格 */
/* 使选中项使用 Bootstrap 的蓝底白字 */
.select2-container--default .select2-results__option--selected {
  background-color: #0d6efd !important;
  color: white !important;
}

/* 高亮状态（鼠标悬停）保持蓝底白字 */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #0d6efd !important;
  color: white !important;
}

/* 高亮且选中状态 */
.select2-container--default .select2-results__option--highlighted[aria-selected=true] {
  background-color: #0a58ca !important; /* 稍深一点的蓝色 */
  color: white !important;
}

/* 使单选框外观和 Bootstrap 一致 */
.select2-container--default .select2-selection--single {
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
}

/* 调整单选框的文本位置 */
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #212529;
  line-height: 1.5;
  padding-left: 0;
}

/* 下拉箭头位置调整 */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  top: 0;
  right: 0.75rem;
}

/* 下拉容器样式 */
.select2-dropdown {
  border-color: #ced4da;
  border-radius: 0.25rem;
}

/* 搜索框样式 */
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
}

/* 聚焦时的样式 */
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 下拉框打开时的边框样式 */
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Hierarchy Tree Styles */
.hierarchy-tree {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.region-node, .cost-center-node {
  position: relative;
}

.cost-centers-container {
  position: relative;
  padding-left: 1rem;
}

.cost-centers-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-left: 2px solid #dee2e6;
}

.cost-center-node {
  padding-left: 1.5rem;
  position: relative;
}

.cost-center-node::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 0;
  width: 1.5rem;
  border-top: 2px solid #dee2e6;
}

.company-entities-container, .departments-container {
  margin-bottom: 1rem;
}

/* 项目列表中的迷你图表样式 */
.mini-progress-container {
  margin: 3px 0;
}

.mini-progress {
  height: 5px;
  background-color: #eee;
  border-radius: 2px;
  margin: 3px 0;
  overflow: hidden;
}

.mini-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.mini-progress-success {
  background-color: #28a745;
}

.mini-progress-warning {
  background-color: #ffc107;
}

.mini-progress-danger {
  background-color: #dc3545;
}

.mini-progress-label {
  font-size: 0.75rem;
  font-weight: 500;
}

.project-stats-cell {
  min-width: 200px;
}