/* ==================================================================
 * JobTrack · 设计系统
 * ================================================================== */

html, body {
  background: #fafbff;
}

/* ---------- 页面装饰背景 ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.page-bg .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.page-bg .blob-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle at 30% 30%, #c4b5fd, transparent 70%);
  top: -200px; left: -150px;
}
.page-bg .blob-2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle at 50% 50%, #fbcfe8, transparent 70%);
  top: 20%; right: -160px;
}
.page-bg .grid-mask {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(99,102,241,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99,102,241,0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center top, black, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center top, black, transparent 70%);
}

/* ---------- 通用表面卡片 ---------- */
.surface {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226,232,240,0.8);
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(15,23,42,0.03),
    0 8px 24px -12px rgba(99,102,241,0.10);
}

/* ---------- 导航按钮 ---------- */
.nav-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border-radius: 12px;
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}
.nav-btn.active {
  background: white;
  color: #4f46e5;
  box-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 4px 12px -4px rgba(99,102,241,0.2);
}
.nav-btn:hover:not(.active) {
  color: #1e293b;
  background: rgba(255,255,255,0.6);
}

.nav-btn-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 12px;
  transition: all 0.2s;
  cursor: pointer;
  font-family: inherit;
}
.nav-btn-mobile.active {
  color: #4f46e5;
  background: #eef2ff;
}

/* ---------- 指标卡 ---------- */
.metric-card {
  background: white;
  border: 1px solid rgba(226,232,240,0.7);
  border-radius: 20px;
  padding: 18px;
  position: relative;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(15,23,42,0.02);
}
.metric-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 4px 12px -4px rgba(99,102,241,0.15);
  transform: translateY(-2px);
}
.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}
.metric-num {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-top: 4px;
}
.metric-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* ---------- 输入控件 ---------- */
.lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(203,213,225,0.8);
  border-radius: 12px;
  font-size: 13px;
  background: white;
  transition: all 0.15s;
  font-family: inherit;
  color: #0f172a;
}
.input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.input-select {
  padding: 10px 14px;
  border: 1px solid rgba(203,213,225,0.8);
  border-radius: 12px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.input-select:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

/* ---------- 按钮 ---------- */
.btn-primary {
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 12px -2px rgba(99,102,241,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(99,102,241,0.5);
}
.btn-secondary {
  padding: 10px 18px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.data-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #f8fafc;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.data-btn:hover {
  background: #f1f5f9;
  border-color: rgba(203,213,225,0.8);
}

/* ---------- 看板 Kanban ---------- */
.kanban-col {
  flex: 0 0 300px;
  min-height: 400px;
  background: rgba(241,245,249,0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226,232,240,0.6);
  border-radius: 20px;
  padding: 14px;
  transition: all 0.2s;
}
.kanban-col.drag-target {
  background: rgba(199,210,254,0.4);
  border-color: rgba(99,102,241,0.5);
  border-style: dashed;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.kanban-col-title {
  font-weight: 700;
  font-size: 13px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}
.kanban-col-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: white;
  padding: 2px 9px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

/* ---------- 卡片 ---------- */
.app-card {
  background: white;
  border-radius: 16px;
  padding: 14px 14px 12px 18px;
  margin-bottom: 10px;
  border: 1px solid rgba(226,232,240,0.7);
  cursor: grab;
  transition: all 0.15s;
  position: relative;
  box-shadow: 0 1px 2px rgba(15,23,42,0.02);
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px -4px rgba(99,102,241,0.18);
  border-color: rgba(165,180,252,0.6);
}
.app-card.dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.app-card-priority {
  position: absolute;
  top: 10px;
  left: 6px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
}
.priority-high { background: linear-gradient(to bottom, #ef4444, #f97316); }
.priority-medium { background: linear-gradient(to bottom, #f59e0b, #fbbf24); }
.priority-low { background: #cbd5e1; }

.app-card-company {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.app-card-role {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
  font-weight: 500;
}
.app-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.app-card-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}
.app-card-tag.urgent {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #b91c1c;
}
.app-card-tag.warning {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}

/* ---------- 视图切换动画 ---------- */
.view {
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 日历 ---------- */
.cal-day {
  min-height: 80px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(248,250,252,0.7);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-day:hover {
  background: white;
  border-color: rgba(165,180,252,0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px -2px rgba(99,102,241,0.15);
}
.cal-day.today {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}
.cal-day.today .cal-day-num {
  color: #4f46e5;
  font-weight: 800;
}
.cal-day.other-month {
  opacity: 0.3;
}
.cal-day-num {
  font-weight: 600;
  color: #334155;
}
.cal-day-events {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-event-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: white;
  border-left: 3px solid #6366f1;
  color: #334155;
}

/* ---------- 漏斗图（SVG） ---------- */
.funnel-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.funnel-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* ---------- 清单项 ---------- */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  transition: background 0.15s;
}
.checklist-item:hover { background: rgba(226,232,240,0.4); }
.checklist-item input[type="checkbox"] {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.checklist-item label {
  flex: 1;
  cursor: pointer;
  font-weight: 500;
  color: #334155;
}
.checklist-item.done label {
  text-decoration: line-through;
  color: #94a3b8;
  font-weight: 400;
}
.checklist-item .del-btn {
  opacity: 0;
  color: #94a3b8;
  font-size: 12px;
  transition: opacity 0.15s;
  background: none;
  border: none;
  cursor: pointer;
}
.checklist-item:hover .del-btn { opacity: 1; }
.checklist-item .del-btn:hover { color: #ef4444; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: modalBgIn 0.2s ease-out;
}
.modal.hidden { display: none; }
@media (min-width: 768px) {
  .modal { align-items: center; }
}

.modal-card {
  width: 100%;
  background: white;
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(15,23,42,0.4);
  margin: 24px 0;
  overflow: hidden;
  animation: modalCardIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 详情弹窗 ---------- */
#d-hero-bg { background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #ec4899); }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  background: white;
  color: #334155;
  border-color: rgba(203,213,225,0.8);
}
.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(15,23,42,0.1);
}
.action-btn.primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 10px -2px rgba(99,102,241,0.35);
}
.action-btn.danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.action-btn.success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
.action-btn.warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.info-cell {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
}
.info-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.info-cell-value {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  position: relative;
}
.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.timeline-content {
  flex: 1;
  padding-top: 3px;
}
.timeline-content .tl-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.timeline-content .tl-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

/* ---------- Toast ---------- */
#toast.show {
  display: block;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(203,213,225,0.6); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.8); }

/* ---------- 紧急待办行 ---------- */
.urgent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,0.8);
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}
.urgent-row:hover {
  border-color: rgba(165,180,252,0.6);
  background: rgba(238,242,255,0.4);
  transform: translateX(2px);
}

/* ---------- 状态 chip ---------- */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
