/* ============================================
   工作台页面专用样式
   暗黑科技风 · 移动端优先
   ============================================ */

/* ---- 工作台头部 ---- */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ---- 角色切换下拉 ---- */
.role-switcher {
  position: relative;
  flex-shrink: 0;
}

.role-switcher__trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.role-switcher__trigger:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
}

.role-switcher__trigger:active {
  transform: scale(0.97);
}

.role-switcher__icon {
  font-size: 1rem;
  line-height: 1;
}

.role-switcher__name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.role-switcher__arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.role-switcher__arrow--open {
  transform: rotate(180deg);
}

/* 角色下拉菜单 */
.role-switcher__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 4px;
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.role-switcher__dropdown--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.role-switcher__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.role-switcher__option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.role-switcher__option--active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
}

.role-switcher__option-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

.role-switcher__option-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.role-switcher__option-name {
  font-weight: 500;
}

.role-switcher__option-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ---- 搜索框 ---- */
.dash-search {
  flex: 1;
  min-width: 0;
}

.dash-search .input {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

/* ---- 工作台内容区 ---- */
.dash-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ---- KPI 卡片网格 ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.kpi-grid .stat-card {
  padding: var(--space-md);
}

.kpi-grid .stat-value {
  font-size: 1.3rem;
}

/* ---- 区块标题 ---- */
.section-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: var(--space-sm) 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--neon-cyan);
  flex-shrink: 0;
}

/* ---- 项目健康度列表 ---- */
.health-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.health-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.health-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-dot--active {
  background: var(--success);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.health-dot--risk {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

.health-dot--pending {
  background: #6b7280;
}

.health-dot--completed {
  background: var(--neon-cyan);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.health-name {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-progress {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  width: 36px;
  text-align: right;
}

.health-status {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.health-status--active {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.health-status--risk {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.health-status--pending {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

.health-status--completed {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
}

/* ---- 利润趋势区块 ---- */
.trend-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.trend-label {
  color: var(--text-muted);
}

.trend-value {
  color: var(--text-primary);
  font-weight: 600;
}

.trend-chart {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
}

/* ---- 待审批列表 ---- */
.approval-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.approval-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.approval-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.approval-item__title {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-item__btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--neon-cyan);
  color: #0a0a0f;
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}

.approval-item__btn:hover {
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

/* ---- 项目概览统计 ---- */
.overview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.overview-stat {
  text-align: center;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.overview-stat__value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.overview-stat__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- 项目进度卡片 ---- */
.project-card {
  padding: var(--space-md);
  cursor: pointer;
  transition: background 0.15s;
}

.project-card:active {
  background: rgba(255, 255, 255, 0.06);
}

.project-card + .project-card {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.project-card__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card__percent {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neon-cyan);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.project-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.project-card__meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

.project-card__next {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.project-card__next-label {
  color: var(--text-muted);
}

/* ---- 风险预警列表 ---- */
.risk-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.risk-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.risk-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.risk-item__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.risk-item__dot--high {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.5);
}

.risk-item__dot--mid {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.risk-item__dot--low {
  background: var(--success);
}

.risk-item__text {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-item__level {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

.risk-item__level--high {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.risk-item__level--mid {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.risk-item__level--low {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

/* ---- 人员负荷 ---- */
.workload-chart {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
}

/* ---- 今日待办 ---- */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  cursor: pointer;
}

.todo-item:active {
  background: rgba(255, 255, 255, 0.04);
}

.todo-item__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: all 0.2s;
}

.todo-item__check--done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.todo-item__text {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-item__text--done {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ---- 任务进度列表 ---- */
.task-progress-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.task-progress-item {
  padding: var(--space-sm) 0;
}

.task-progress-item + .task-progress-item {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.task-progress-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.task-progress-item__name {
  font-size: 0.8rem;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-progress-item__percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-cyan);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

/* ---- 工时概览 ---- */
.workhour-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: var(--space-sm) 0;
}

.workhour-summary__value {
  font-weight: 600;
  color: var(--neon-cyan);
}

.workhour-summary__label {
  color: var(--text-muted);
}

.workhour-chart {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
}

/* ---- 快捷操作 ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-md) var(--space-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.quick-action-btn:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.06);
}

.quick-action-btn:active {
  transform: scale(0.95);
}

.quick-action-btn__icon {
  font-size: 1.2rem;
}

.quick-action-btn__label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* ---- 合同台账摘要 ---- */
.contract-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contract-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.contract-summary__label {
  color: var(--text-muted);
}

.contract-summary__value {
  color: var(--text-primary);
  font-weight: 500;
}

.contract-summary__chart {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) 0;
}

/* ---- 待审批付款 ---- */
.payment-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.payment-item__info {
  flex: 1;
  min-width: 0;
}

.payment-item__name {
  font-size: 0.8rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-item__amount {
  font-size: 0.75rem;
  color: var(--neon-cyan);
  font-weight: 600;
  margin-top: 2px;
}

/* ---- 空状态 ---- */
.dash-empty {
  text-align: center;
  padding: var(--space-xl) 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
