/* ============================================================
   棱镜业务管理平台 — 极简硬朗主题覆盖层
   设计语言：小圆角 / 纯色块 / 左侧色条 / 深色表头
   在 style.css 之后加载
   ============================================================ */

/* ---- 侧边栏：加宽 + 品牌区居中堆叠 ---- */
.sidebar {
  width: 232px;
  background: linear-gradient(180deg, #150a30 0%, #1a0f33 100%);
}
.main { margin-left: 232px; }

.brand {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 20px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
/* 菱形 LOGO（棱镜折射意象） */
.brand-logo {
  width: 46px; height: 46px; margin-bottom: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  transform: rotate(45deg);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(124,58,237,0.45);
}
.brand-logo span {
  transform: rotate(-45deg);
  color: #fff; font-size: 20px; font-weight: 800;
  display: block; line-height: 1;
  text-shadow: 0 2px 5px rgba(0,0,0,0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { font-size: 14px; color: #fff; letter-spacing: 2px; white-space: nowrap; }
.brand-text span {
  font-size: 8px; color: rgba(255,255,255,0.35);
  letter-spacing: 2.5px; margin-top: 4px; white-space: nowrap;
}
/* 品牌区下方渐变细线 */
.sidebar .nav-wrap { position: relative; }
.sidebar .nav-wrap::before {
  content: '';
  display: block;
  width: 56px; height: 2px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
  margin: 4px auto 14px;
}

/* ---- 导航项：无符号、菱形指示器、左侧亮条 ---- */
.sidebar .nav-item {
  position: relative;
  border-radius: 3px;
  margin: 3px 10px;
  padding: 11px 16px 11px 26px;
  font-size: 13.5px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.62);
  border-left: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar .nav-item::before {
  content: '';
  position: absolute; left: 10px; top: 50%;
  width: 6px; height: 6px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(255,255,255,0.18);
  transition: background 0.15s;
  border-radius: 1px;
}
.sidebar .nav-item:hover {
  background: rgba(139,92,246,0.14);
  color: #fff;
}
.sidebar .nav-item:hover::before { background: #a78bfa; }
.sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(124,58,237,0.32), rgba(6,182,212,0.14));
  color: #fff;
  border-left: 3px solid #06b6d4;
  padding-left: 23px;
}
.sidebar .nav-item.active::before {
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(167,139,250,0.8);
}
/* 分组标题 */
.sidebar .nav-wrap > div {
  font-size: 10px; letter-spacing: 3px;
  color: rgba(255,255,255,0.3);
  padding: 12px 20px 4px !important;
}

/* ---- 主内容区：浅灰紫纯色 ---- */
.main {
  background: #f4f2fa;
  padding: 22px 26px;
}

/* ---- 页面头部：标题前小菱形 ---- */
.page-header { margin-bottom: 20px; }
.page-header h2 { letter-spacing: 1px; }
.page-header h2::before {
  content: '';
  display: inline-block; width: 8px; height: 8px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  transform: rotate(45deg);
  border-radius: 2px; margin-right: 10px; vertical-align: 1px;
}

/* ---- 卡片：小圆角、纯白、左侧色条、不上浮 ---- */
.card {
  border-radius: 4px;
  border: 1px solid #e6e0f5;
  background: #fff;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #7c3aed, #06b6d4);
}
.card:hover {
  transform: none;
  border-color: #c4b5fd;
  box-shadow: 0 2px 10px rgba(80,50,160,0.08);
}
.card h3 { color: #665a8c; letter-spacing: 1.5px; }
.row .card .value { color: #7c3aed; }

/* ---- 按钮：纯色、小圆角、无渐变无重阴影 ---- */
.btn {
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #7c3aed; }
.btn-primary:hover { background: #6d28d9 !important; }
.btn-success { background: #0891b2; }
.btn-success:hover { background: #0e7490 !important; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c !important; }
.btn-outline { border-radius: 4px; }
.btn-outline:hover { border-color: #7c3aed; color: #6d28d9; background: #f5f3ff !important; }

/* ---- 表格：深紫表头、无斑马纹、分隔线 ---- */
.table-wrap {
  border: 1px solid #e6e0f5;
  border-radius: 4px;
  background: #fff;
}
.table-wrap table { border-collapse: collapse; }
.table-wrap th {
  background: #2a1757;
  color: #e9e4fa;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 12px 12px;
  border-bottom: 1px solid #3b2470;
}
.table-wrap td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0ecfa;
}
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr:nth-child(even) { background: #fff; }
.table-wrap tbody tr:hover { background: #f5f2fd !important; }

/* ---- 徽章：方形小圆角 ---- */
.badge { border-radius: 2px; font-weight: 600; letter-spacing: 0.5px; padding: 3px 8px; }
.badge-success { background: #cffafe; color: #0e7490; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #ede9fe; color: #6d28d9; }
.badge-gray { background: #eef0f6; color: #665a8c; }

/* ---- 筛选按钮 ---- */
.filter-bar .filter-btn { border-radius: 3px; }
.filter-bar .filter-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  box-shadow: none;
}

/* ---- 弹窗 / 抽屉：小圆角 ---- */
.modal { border-radius: 6px; border: 1px solid #ddd6f0; }
.modal h3 { color: #241d3f; }
.modal .modal-actions { border-top-color: #ece8f6; }
.drawer-header { border-bottom-color: #ece8f6; }
.drawer-header h3 { color: #241d3f; }

/* ---- 表单聚焦：紫色边框 + 左侧加粗 ---- */
.form-group input, .form-group select, .form-group textarea { border-radius: 4px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 2px rgba(124,58,237,0.12) !important;
}

/* ---- 进度条（PM 看板） ---- */
.pm-bprog .pm-fill { background: linear-gradient(90deg, #7c3aed, #06b6d4) !important; }
.pm-tab.active { background: #7c3aed !important; }

/* ---- PM 统计卡片 ---- */
.pm-stat { border-radius: 4px; }
.pm-stat-icon { background: #f5f3ff !important; color: #7c3aed; border-radius: 3px; }

/* ---- 滚动条：紫色细条 ---- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9bde8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a893d8; }

/* ---- 空状态 ---- */
.empty-state { color: #8376a9; }

/* ---- AI 助手按钮 ---- */
#aiToggle, .ai-toggle { background: #7c3aed !important; border-radius: 4px !important; }

/* ---- 移动端菜单按钮 ---- */
.menu-toggle { background: #1a0f33 !important; border-radius: 4px; }

/* ============================================================
   骨架级重构：侧边栏 → 顶部导航栏（3号是左侧竖栏，4号是顶横栏）
   纯 CSS 覆盖，JS 逻辑零改动
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; right: 0;
  width: 100%; height: 58px;
  display: flex; flex-direction: row; align-items: center;
  padding: 0 18px;
  background: linear-gradient(90deg, #150a30 0%, #241257 60%, #1c1040 100%);
  z-index: 100;
  box-shadow: 0 2px 12px rgba(20,8,50,0.35);
}
/* 品牌区：横排紧凑 */
.sidebar .brand {
  flex-direction: row; align-items: center;
  padding: 0 22px 0 0; margin: 0;
  border-bottom: none;
  border-right: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  flex-shrink: 0;
}
.sidebar .brand-logo {
  width: 36px; height: 36px; margin: 0 12px 0 0;
  border-radius: 8px;
}
.sidebar .brand-logo span { font-size: 16px; }
.sidebar .brand-text strong { font-size: 13px; letter-spacing: 1px; }
.sidebar .brand-text span { display: none; }
/* 导航：横排滚动 */
.sidebar .nav-wrap {
  display: flex; flex-direction: row; align-items: center;
  flex: 1; min-width: 0;
  height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.sidebar .nav-wrap::-webkit-scrollbar { display: none; }
.sidebar .nav-wrap::before { display: none; }
.sidebar .nav-wrap > div { display: none; }
.sidebar .nav-item {
  display: flex; align-items: center;
  margin: 0 2px; padding: 8px 14px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar .nav-item::before {
  width: 5px; height: 5px;
  margin-right: 7px;
  position: static;
  transform: none;
}
.sidebar .nav-item.active {
  background: rgba(124,58,237,0.32);
  border-left: none;
  border-bottom: 3px solid #06b6d4;
  padding-left: 14px;
}
/* 用户信息（auth.js 注入）：钉在顶栏右侧 */
.sidebar > div[style*="padding:16px 20px"] {
  position: absolute; right: 18px; top: 0; bottom: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 !important;
  border-top: none !important;
  flex-shrink: 0;
}
.sidebar > div[style*="padding:16px 20px"] > div:nth-child(1) {
  font-size: 13px !important; color: rgba(255,255,255,0.75) !important;
  white-space: nowrap;
}
.sidebar > div[style*="padding:16px 20px"] > div:nth-child(2) { display: none !important; }
.sidebar > div[style*="padding:16px 20px"] > div:nth-child(3) {
  display: flex; gap: 14px; margin: 0 !important;
  white-space: nowrap;
}
.sidebar > div[style*="padding:16px 20px"] a {
  font-size: 12px; color: #a78bfa !important;
}
.sidebar > div[style*="padding:16px 20px"] a:hover { color: #fff !important; }
/* 主区：让出顶栏高度 */
.main {
  margin-left: 0;
  padding: 76px 26px 26px;
  min-height: 100vh;
}
/* 移动端（≤768px）：顶栏恢复为左侧抽屉 */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 260px; height: 100vh;
    flex-direction: column; align-items: stretch;
    padding: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand {
    flex-direction: column; align-items: center;
    padding: 20px; margin-bottom: 6px;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
  }
  .sidebar .brand-logo { width: 46px; height: 46px; margin: 0 0 12px; border-radius: 10px; }
  .sidebar .brand-logo span { font-size: 20px; }
  .sidebar .brand-text span { display: block; }
  .sidebar .nav-wrap {
    flex-direction: column; align-items: stretch;
    overflow-y: auto; overflow-x: hidden;
    height: auto;
    scrollbar-width: auto;
  }
  .sidebar .nav-wrap > div { display: block; }
  .sidebar .nav-item {
    margin: 3px 10px; padding: 11px 16px 11px 26px;
    font-size: 13.5px;
  }
  .sidebar .nav-item::before { position: absolute; left: 10px; top: 50%; transform: translateY(-50%) rotate(45deg); margin: 0; }
  .sidebar .nav-item.active { border-left: 3px solid #06b6d4; border-bottom: none; padding-left: 23px; }
  .sidebar > div[style*="padding:16px 20px"] {
    position: static;
    flex-direction: column; align-items: flex-start;
    padding: 16px 20px !important;
    border-top: 1px solid rgba(255,255,255,0.06) !important;
    gap: 6px;
  }
  .sidebar > div[style*="padding:16px 20px"] > div:nth-child(2) { display: block !important; }
  .main { padding-top: 20px; }
}
