/*
 * 绩效管理系统
 * Design System: Apple / Pinguo-inspired（依据前端原型移植）
 * Style: Restrained, elegant, professional
 */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Apple semantic aliases */
  --apple-background: #ffffff;
  --apple-foreground: #1d1d1f;
  --apple-card: #ffffff;
  --apple-card-foreground: #1d1d1f;
  --apple-primary: #0066cc;
  --apple-primary-foreground: #ffffff;
  --apple-secondary: #f5f5f7;
  --apple-secondary-foreground: #1d1d1f;
  --apple-muted: #f5f5f7;
  --apple-muted-foreground: #6e6e73;
  --apple-accent: #f2f2f7;
  --apple-accent-foreground: #1d1d1f;
  --apple-destructive: #ff3b30;
  --apple-destructive-foreground: #ffffff;
  --apple-success: #34c759;
  --apple-success-foreground: #ffffff;
  --apple-warning: #ff9500;
  --apple-border: #e5e5ea;
  --apple-input: #d1d1d6;
  --apple-ring: #0066cc;

  /* Primitive palette */
  --brand-50: #e8f2ff;
  --brand-100: #cfe5ff;
  --brand-200: #9fcbff;
  --brand-300: #66abff;
  --brand-400: #2e8dff;
  --brand-500: #007aff;
  --brand-600: #0064d6;
  --brand-700: #004fad;
  --background-50: #ffffff;
  --background-100: #f7f7fa;
  --background-200: #f2f2f7;
  --background-300: #e5e5ea;
  --background-400: #d1d1d6;
  --background-500: #aeaeb2;
  --background-600: #8e8e93;
  --background-700: #3a3a3c;
  --background-800: #1c1c1e;
  --background-900: #000000;
  --text-400: #8e8e93;
  --text-500: #6e6e73;
  --text-600: #48484a;
  --text-700: #3c3c43;
  --text-800: #1d1d1f;
  --text-900: #000000;

  /* Typography */
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Noto Sans CJK SC", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Monaco, monospace;

  /* Spacing & Radius */
  --radius: 1.2rem;
  --radius-sm: 0.8rem;
  --radius-lg: 1.6rem;
  --radius-pill: 9999px;
  --spacing-base: 0.24rem;

  /* Shadows */
  --shadow-2xs: 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 1px 3px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px -8px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 16px 40px -10px rgba(0, 0, 0, 0.10), 0 8px 16px -8px rgba(0, 0, 0, 0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--background-100);
  color: var(--text-800);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--apple-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-600);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.text-muted { color: var(--text-500); }
.text-small { font-size: 0.875rem; }
.text-mono { font-family: var(--font-mono); }

/* ===== LAYOUT ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--background-50);
  border-right: 1px solid var(--apple-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px;
  border-bottom: 1px solid var(--apple-border);
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-900);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-500);
  margin-top: 2px;
}

/* ===== 待办模块 ===== */
.sidebar-todo {
  padding: 8px 12px 0;
}
.nav-badge-danger {
  background: var(--apple-destructive);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: auto;
}
.todo-nav-item {
  margin-bottom: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-400);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-600);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
  margin-bottom: 2px;
  cursor: pointer;
  user-select: none;
}

.nav-item:hover {
  background: var(--background-200);
  color: var(--text-800);
}

.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-600);
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--apple-destructive);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--apple-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--background-100);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-800);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-500);
}

.sidebar-logout {
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-500);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.sidebar-logout:hover {
  background: #ffecea;
  color: var(--apple-destructive);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-container {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== COMPONENTS ===== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 提交加载：按钮内 spinner + 不可重复点击 */
.btn-spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0.9;
}
.btn.is-loading {
  pointer-events: none;
}

.btn-primary {
  background: var(--apple-primary);
  color: var(--apple-primary-foreground);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-600);
  color: var(--apple-primary-foreground);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--background-200);
  color: var(--text-800);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--background-300);
  color: var(--text-900);
}

.btn-ghost {
  background: transparent;
  color: var(--text-600);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--background-200);
  color: var(--text-800);
}

.btn-destructive {
  background: var(--apple-destructive);
  color: var(--apple-destructive-foreground);
}

.btn-destructive:hover:not(:disabled) {
  background: #ff453a;
}

.btn-success {
  background: var(--apple-success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #28a745;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

/* Cards */
.card {
  background: var(--apple-card);
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-900);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-500);
  margin-top: 2px;
}

.card-body {
  padding: 24px;
}

.card-body.no-pad {
  padding: 0;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--apple-border);
  background: var(--background-50);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--apple-card);
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  padding: 20px 24px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 2px 8px rgba(0,0,0,0.04);
  transition: all var(--duration-fast) var(--ease-out);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-500);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-900);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-value.primary { color: #1890ff; }
.stat-value.success { color: #52c41a; }
.stat-value.warning { color: #fa8c16; }
.stat-value.danger { color: var(--apple-destructive); }
.stat-value.purple { color: #af52de; }

.stat-change {
  font-size: 0.8rem;
  margin-top: 8px;
  font-weight: 500;
}

.stat-change.positive { color: var(--apple-success); }
.stat-change.neutral { color: var(--text-500); }
.stat-change.negative { color: var(--apple-destructive); }

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-pending {
  background: #fff8e6;
  color: #b38600;
}

.badge-pending .badge-dot { background: var(--apple-warning); }

.badge-progress {
  background: var(--brand-50);
  color: var(--brand-700);
}

.badge-progress .badge-dot { background: var(--brand-500); }

.badge-success {
  background: #e9f9ee;
  color: #1a6b3a;
}

.badge-success .badge-dot { background: var(--apple-success); }

.badge-danger {
  background: #ffecea;
  color: #991b1b;
}

.badge-danger .badge-dot { background: var(--apple-destructive); }

.badge-muted {
  background: var(--background-200);
  color: var(--text-500);
}

.badge-muted .badge-dot { background: var(--text-400); }

.badge-purple {
  background: #f0e6ff;
  color: #5a2d8c;
}

.badge-purple .badge-dot { background: #af52de; }

.badge-blue {
  background: #e6f3ff;
  color: #0a4a8c;
}

.badge-blue .badge-dot { background: var(--brand-500); }

.badge-orange {
  background: #fff0e6;
  color: #8c4a0a;
}

.badge-orange .badge-dot { background: var(--apple-warning); }

.badge-teal {
  background: #e6f9f9;
  color: #0a6b6b;
}

.badge-teal .badge-dot { background: #30b0c7; }

.badge-gray {
  background: var(--background-200);
  color: var(--text-500);
}

.badge-gray .badge-dot { background: var(--text-400); }

.badge-green {
  background: #e9f9ee;
  color: #1a6b3a;
}

.badge-green .badge-dot { background: var(--apple-success); }

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-700);
  margin-bottom: 8px;
}

.form-label .required {
  color: var(--apple-destructive);
  margin-left: 2px;
}

.field-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--background-300);
  color: var(--text-500);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}
.field-tip:hover {
  background: var(--brand-500);
  color: #fff;
}

/* fixed 定位的 tooltip 浮层（JS 动态创建，挂到 body，避免被父级 overflow 裁剪） */
.field-tooltip {
  position: fixed;
  z-index: 10000;
  background: #1d1d1f;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 420px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease-out;
}
.field-tooltip.visible {
  opacity: 1;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-500);
  margin-top: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--apple-input);
  border-radius: var(--radius-sm);
  background: var(--background-50);
  color: var(--text-800);
  font-size: 0.95rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-control:focus {
  outline: none;
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-control::placeholder {
  color: var(--text-400);
}

.form-control:disabled,
.form-control[readonly] {
  background: var(--background-200);
  color: var(--text-500);
  cursor: not-allowed;
}

.form-control.err {
  border-color: var(--apple-destructive);
  background: #fff4f3;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 40px;
  cursor: pointer;
  border-radius: 1.2rem;
}
select.form-control:focus {
  border-color: #0071e3;
  box-shadow: none;
}

/* ===== Select 下拉菜单组件（Apple 风格） ===== */
.form-select {
  appearance: none;
  width: 100%;
  height: 40px;
  padding: 0 40px 0 16px;
  border: 1px solid #d2d2d7;
  border-radius: 1.2rem;
  background: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  color: #1d1d1f;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.form-select:hover {
  border-color: #86868b;
}
.form-select:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: none;
}
.form-select:disabled {
  background-color: #f5f5f7;
  border-color: #e8e8ed;
  color: #86868b;
  cursor: not-allowed;
  opacity: 0.4;
}
.form-select option {
  padding: 8px 16px;
  font-size: 0.9rem;
  color: #1d1d1f;
}

/* 筛选栏专用 - 小尺寸 select */
.filter-select {
  appearance: none;
  height: 32px;
  padding: 0 36px 0 12px;
  border: 1px solid #d2d2d7;
  border-radius: 0.8rem;
  background: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  color: #1d1d1f;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 200ms ease-out;
  min-width: 160px;
}
.filter-select:hover {
  border-color: #86868b;
}
.filter-select:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 发起考核面板 */
.launch-group {
  margin-bottom: 12px;
}

.launch-dept {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-500);
  margin-bottom: 6px;
}

.launch-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.launch-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-sm);
  background: var(--apple-card);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}

.launch-member:hover {
  border-color: var(--brand-300);
}

.launch-member:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-50);
  color: var(--brand-700);
}

.launch-check {
  accent-color: var(--brand-600);
}

/* ===== Modal 弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 200ms ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: #fff;
  border-radius: 1.4rem;
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.25);
  width: 720px;
  max-width: 94vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 200ms ease-out;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-500);
  font-size: 1.2rem;
  transition: background var(--duration-fast) var(--ease-out);
}
.modal-close:hover {
  background: var(--background-200);
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--apple-border);
  flex-shrink: 0;
}

/* 发起考核弹窗 - 部门选择 */
.launch-dept-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}
.launch-dept-check {
  accent-color: var(--brand-600);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.launch-dept-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-600);
}
.launch-dept-count {
  font-size: 0.75rem;
  color: var(--text-400);
  font-weight: 400;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-600);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e8e8e8;
  background: #fafafa;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e8e8e8;
  color: var(--text-800);
  vertical-align: middle;
}

.data-table .td-zero {
  color: #bfbfbf;
}

.data-table tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

.data-table tbody tr:hover {
  background: var(--background-100);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .dim-row td {
  background: var(--background-100);
  font-weight: 600;
  color: var(--text-700);
}

/* ---- Score breakdown (member confirm result) ---- */
.sb { font-size: 0.9rem; }
.sb-dim {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 4px 10px;
  font-weight: 600;
  color: var(--text-800);
  font-size: 0.95rem;
}
.sb-dim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sb-dim-weight {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-500);
  letter-spacing: 0.02em;
  background: var(--background-100);
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sb-ind {
  margin: 0 2px 14px;
  border: 1px solid var(--border-100, #efeff1);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.sb-ind:hover {
  border-color: #d8d8de;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}
.sb-ind-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}
.sb-ind-name {
  font-weight: 600;
  color: var(--text-800);
  min-width: 0;
}
.sb-stats {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  margin-left: auto;
}
.sb-stat {
  text-align: right;
  white-space: nowrap;
}
.sb-stat small {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-400);
  margin-bottom: 2px;
}
.sb-stat .sb-val {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-800);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.sb-stat.is-primary .sb-val {
  font-size: 1.15rem;
  color: var(--apple-primary, #0071e3);
}
.sb-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 12px 16px 14px;
  background: #fafafc;
  border-top: 1px dashed #e7e7ec;
}
.sb-field { min-width: 0; }
.sb-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-500);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sb-field-label::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
.sb-field-body {
  font-size: 0.85rem;
  color: var(--text-700);
  line-height: 1.7;
  background: #fff;
  border: 1px solid var(--border-100, #efeff1);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 20px;
  word-break: break-word;
}
.sb-adj {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 4px 2px 0;
  padding: 12px 16px;
  border-radius: 12px;
}
.sb-adj .sb-adj-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.sb-adj .sb-adj-reason { font-size: 0.78rem; color: var(--text-500); line-height: 1.5; }
.sb-adj .sb-adj-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.95rem; }
.sb-adj.sb-plus { background: rgba(52, 199, 89, 0.06); }
.sb-adj.sb-plus .sb-adj-name, .sb-adj.sb-plus .sb-adj-val { color: #2e7d32; }
.sb-adj.sb-minus { background: rgba(255, 59, 48, 0.05); }
.sb-adj.sb-minus .sb-adj-name, .sb-adj.sb-minus .sb-adj-val { color: #c62828; }
.sb-total {
  display: flex;
  align-items: center;
  margin: 14px 2px 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f2f6ff, #eef3ff);
  border: 1px solid #e0e9ff;
}
.sb-total .sb-total-label {
  font-weight: 600;
  color: var(--text-700);
  font-size: 0.95rem;
}
.sb-total .sb-total-val {
  margin-left: auto;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--apple-primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Progress */
.progress-bar {
  height: 6px;
  background: #f0f0f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #1890ff;
  border-radius: 999px;
  transition: width var(--duration-slow) var(--ease-out);
}

.progress-fill.success { background: #52c41a; }
.progress-fill.warning { background: #fa8c16; }

/* Timeline / Steps */
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-500);
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--background-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-500);
  flex-shrink: 0;
}

.step.active .step-dot {
  background: var(--apple-primary);
  color: white;
}

.step.completed .step-dot {
  background: var(--apple-success);
  color: white;
}

.step.active { color: var(--apple-primary); }
.step.completed { color: var(--text-700); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--background-300);
  max-width: 40px;
}

/* Section blocks */
.section-block {
  background: var(--apple-card);
  border-radius: var(--radius);
  border: 1px solid var(--apple-border);
  margin-bottom: 24px;
  overflow: hidden;
}

.section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--apple-border);
  background: var(--background-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-900);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.section-body {
  padding: 24px;
}

.section-desc {
  color: var(--text-500);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Goal items */
.goal-item {
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  background: var(--background-50);
  transition: all var(--duration-fast) var(--ease-out);
}

.goal-item:hover {
  border-color: var(--background-400);
  box-shadow: var(--shadow-sm);
}

.goal-item.locked {
  background: var(--background-100);
  border-style: dashed;
}

.goal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.goal-title {
  font-weight: 600;
  color: var(--text-900);
  font-size: 0.95rem;
}

.goal-weight {
  font-size: 0.8rem;
  color: var(--text-500);
  font-weight: 500;
  background: var(--background-200);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.goal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .goal-row {
    grid-template-columns: 1fr;
  }
}

/* SMART diagnostic */
.smart-diagnostic {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.smart-diagnostic.ok {
  background: #e9f9ee;
  color: #1a6b3a;
}

.smart-diagnostic.warn {
  background: #fff8e6;
  color: #b38600;
}

/* Role pills */
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
}

.role-admin { background: #f0e6ff; color: #5a2d8c; }
.role-employee { background: #e6f3ff; color: #0a4a8c; }
.role-manager { background: #e6f9f0; color: #0a6b3a; }
.role-hrbp { background: #fff0e6; color: #8c4a0a; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-500);
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--background-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-400);
  font-size: 1.5rem;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--background-100) 0%, var(--background-200) 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: var(--apple-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--apple-border);
  box-shadow: var(--shadow-xl);
  padding: 48px;
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-500);
  margin-bottom: 32px;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.role-card {
  padding: 20px;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-align: center;
}

.role-card:hover {
  border-color: var(--apple-primary);
  background: var(--brand-50);
}

.role-card.selected {
  border-color: var(--apple-primary);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.role-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.25rem;
}

.role-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-800);
}

.role-card-desc {
  font-size: 0.75rem;
  color: var(--text-500);
  margin-top: 4px;
}

/* Person picker (login) */
.person-picker {
  margin-top: 8px;
  text-align: left;
}

.person-picker .form-label {
  margin-bottom: 8px;
}

.person-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.person-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  border-bottom: 1px solid var(--apple-border);
}

.person-item:last-child {
  border-bottom: none;
}

.person-item:hover {
  background: var(--background-100);
}

.person-item.selected {
  background: var(--brand-50);
}

.person-item .person-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-800);
}

.person-item .person-dept {
  font-size: 0.75rem;
  color: var(--text-500);
}

.person-item .person-role {
  margin-left: auto;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.tab {
  padding: 6px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-500);
  border-radius: 999px;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
  background: none;
  line-height: 1.5;
}

.tab:hover {
  color: var(--text-800);
  background: var(--background-100);
}

.tab.active {
  color: #1890ff;
  background: #e6f7ff;
}

.tab-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 7px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--background-100);
  color: var(--text-500);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}
.tab.active .tab-count {
  background: var(--apple-primary);
  color: #fff;
}

/* Charts */
.chart-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-label {
  width: 90px;
  font-size: 0.85rem;
  color: var(--text-600);
  flex-shrink: 0;
}

.chart-track {
  flex: 1;
  height: 24px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  transition: width var(--duration-slow) var(--ease-out);
}

.chart-track-stacked {
  flex: 1;
  height: 24px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}

.chart-segment {
  height: 100%;
  transition: width var(--duration-slow) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.chart-segment:first-child {
  border-radius: 6px 0 0 6px;
}
.chart-segment:last-child {
  border-radius: 0 6px 6px 0;
}
.chart-segment:only-child {
  border-radius: 6px;
}

.chart-segment-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.chart-value {
  width: 40px;
  font-size: 0.85rem;
  color: var(--text-700);
  font-weight: 600;
  text-align: right;
}

/* Chart legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid #f0f0f0;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-500);
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Donut center text */
.donut-center {
  font-size: 0.75rem;
  color: var(--text-500);
}

.donut-center strong {
  display: block;
  font-size: 1.5rem;
  color: var(--text-900);
  font-weight: 700;
}

/* Person tags in grade table */
.grade-person {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-700);
  line-height: 1.6;
  white-space: nowrap;
}

/* Toolbars */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-box input {
  padding-left: 40px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-400);
  width: 16px;
  height: 16px;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px 16px;
  flex-wrap: wrap;
}

/* 周期弹窗板块分割线 */
.section-divider {
  display: flex;
  align-items: center;
  margin: 20px 0 16px;
  gap: 12px;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--apple-border);
}
.section-divider-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-500);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 周期时间联动说明 */
.cycle-hint {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--brand-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-100);
}
.cycle-hint-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-700);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cycle-hint-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: var(--text-600);
  line-height: 1.8;
}

/* 周期时间锁定提示条 */
.time-lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.time-lock-banner.warn {
  background: #fff8e6;
  border: 1px solid #ffe0a0;
  color: #8a6d00;
}
.time-lock-banner.locked {
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
  color: #666;
}
.time-lock-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.time-lock-icon svg {
  width: 18px;
  height: 18px;
}

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

.page-top h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0;
}

.page-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-500);
}

.page-top-right .period {
  color: var(--text-500);
}

.page-top-right .role-switch {
  color: #1890ff;
  cursor: pointer;
  font-weight: 500;
}

.page-top-right .role-switch:hover {
  color: #096dd9;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin-bottom: 4px;
  font-size: 1.75rem;
}

.page-header p {
  color: var(--text-500);
  font-size: 0.9rem;
}

/* Two column layout */
.two-column {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.side-column {
  min-width: 0;
}

@media (max-width: 1100px) {
  .two-column {
    grid-template-columns: 1fr;
  }
}

/* Name inline input (goal title) - 与 form-control 统一为边框盒式 */
.name-input {
  width: 100%;
  max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--apple-input);
  border-radius: var(--radius-sm);
  background: var(--background-50);
  font-weight: 600;
  color: var(--text-900);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.name-input:focus {
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.name-input::placeholder {
  color: var(--text-400);
  font-weight: 400;
}

/* Weight inline input - 与 form-control 统一为边框盒式 */
.weight-input {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--apple-input);
  border-radius: var(--radius-sm);
  background: var(--background-50);
  font-weight: 600;
  color: var(--text-800);
  text-align: right;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.weight-input:focus {
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.weight-input::placeholder {
  color: var(--text-400);
  font-weight: 400;
}

/* Generic field wrapper */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Summary panel */
.summary-panel {
  background: var(--background-100);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--apple-border);
  font-size: 0.9rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--text-500);
}

.summary-value {
  font-weight: 600;
  color: var(--text-800);
}

.summary-total {
  font-size: 1.1rem;
  color: var(--text-900);
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid var(--apple-border);
}

/* Action bar */
.action-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--apple-border);
}

.action-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #b38600;
  background: #fff8e6;
  border: 1px solid #f5d98a;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.action-hint svg {
  flex-shrink: 0;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-500);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color var(--duration-fast) var(--ease-out);
}

.back-link:hover {
  color: var(--apple-primary);
}

/* Detail head & metrics */
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-head h3 {
  font-size: 1.25rem;
}

.detail-head .badges,
.badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric {
  background: var(--apple-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--apple-border);
}

.metric .k {
  color: var(--text-500);
  font-size: 0.75rem;
  font-weight: 500;
}

.metric .v {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text-800);
  letter-spacing: -0.02em;
}

.metric .v.acc { color: var(--apple-primary); }
.metric .v.success { color: var(--apple-success); }

/* Score rows (manager) */
.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.score-row .score-input {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--apple-input);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: right;
}

.score-row .score-input:focus {
  outline: none;
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.score-row .score-input.err {
  border-color: var(--apple-destructive);
  background: #fff4f3;
}

.score-row .comment-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--apple-input);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.score-row .comment-input:focus {
  outline: none;
  border-color: var(--apple-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.score-row .name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-600);
  white-space: nowrap;
}

.score-row .val {
  font-weight: 700;
  color: var(--text-800);
}

/* Review actions */
.review-actions {
  margin-top: 20px;
}

.review-actions .btnbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 上级审批意见（HRBP 只读展示） */
.manager-comment {
  padding: 12px 14px;
  background: var(--background-100);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-600);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 审核记录时间线（HRBP 查看） */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-color, #e5e7eb);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--apple-success);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--apple-success);
}
.timeline-dot-reject {
  background: var(--apple-danger);
  box-shadow: 0 0 0 2px var(--apple-danger);
}
.timeline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.timeline-action {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-900);
}
.timeline-role {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--background-100);
  color: var(--text-500);
}
.timeline-time {
  font-size: 0.78rem;
  color: var(--text-400);
  margin-left: auto;
}
.timeline-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-500);
  margin-top: 4px;
}
.timeline-comment {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--background-100);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-600);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-change {
  margin-top: 6px;
  padding: 8px 12px;
  background: #fff8e6;
  border: 1px solid #f5d98a;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #8a6d1a;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== 操作记录筛选 ===== */
.log-header {
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-out);
}
.log-header:hover {
  background: var(--background-100);
}
.log-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 6px;
  background: var(--background-200);
  color: var(--text-500);
  font-size: 0.6rem;
  transition: transform var(--duration-normal) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.log-header-open .log-chevron {
  background: var(--brand-100);
  color: var(--brand-600);
}
.log-filter {
  display: flex;
  gap: 6px;
  align-items: center;
}
.log-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--background-300);
  background: var(--background-100);
  color: var(--text-500);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
}
.log-filter-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
}
.log-filter-btn.active {
  background: var(--apple-primary);
  border-color: var(--apple-primary);
  color: var(--apple-primary-foreground);
}
.log-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  line-height: 1;
}
.log-filter-btn.active .log-filter-count {
  background: rgba(255, 255, 255, 0.25);
}

.hrbp-adjust {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.hrbp-adjust .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Info banner */
.info-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.info-banner.ok {
  background: #e9f9ee;
  color: #1a6b3a;
}

.info-banner.info {
  background: var(--brand-50);
  color: var(--brand-700);
}

.info-banner.warn {
  background: #fff8e6;
  color: #b38600;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.5s var(--ease-out) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-900);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  font-size: 0.95rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out);
  max-width: 440px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.ok { background: #1a6b3a; }
.toast.err { background: #991b1b; }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 24px;
  color: var(--text-500);
  font-size: 0.9rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--background-300);
  border-top-color: var(--apple-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--ease-out);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .page-container {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 32px 24px;
  }
}

/* Print */
@media print {
  .sidebar, .topbar, .btn, .action-bar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }
}

/* ===== 团队绩效记录页增强 ===== */
.team-perf-header {
  position: relative;
  overflow: hidden;
  padding-top: 22px;
}
.team-perf-header h1 {
  background: linear-gradient(120deg, var(--text-900) 0%, var(--apple-primary) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.team-perf-accent {
  position: absolute;
  right: 8px;
  top: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0,102,204,.10), rgba(90,200,250,0) 70%);
  pointer-events: none;
}

.team-perf-card {
  position: relative;
  overflow: hidden;
}
.team-perf-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--apple-primary), #5ac8fa 45%, rgba(90,200,250,0));
}
.team-perf-card-header {
  padding-top: 22px;
}
.header-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--apple-primary);
  box-shadow: 0 0 0 4px rgba(0,102,204,.12);
  vertical-align: 1px;
}

/* 表格打磨 */
.team-table-wrap {
  overflow-x: auto;
}
.team-table-wrap .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafa;
}
.team-member-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--apple-primary), #5ac8fa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0,102,204,.22);
}
.team-avatar-done {
  background: linear-gradient(135deg, #34c759, #5ac8fa);
  box-shadow: 0 2px 6px rgba(52,199,89,.26);
}
.cell-sub {
  color: var(--text-600);
}
.score-cell {
  font-weight: 700;
  color: var(--text-900);
  font-variant-numeric: tabular-nums;
}
.grade-chip {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--apple-border);
  color: var(--text-800);
  background: var(--background-100);
}

/* 分页器 */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-top: 1px solid var(--apple-border);
}
.pagination-info {
  font-size: 0.82rem;
  color: var(--text-500);
}
.pagination-info strong {
  color: var(--text-800);
  font-weight: 700;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--apple-border);
  border-radius: 8px;
  background: var(--background-50);
  color: var(--text-700);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover:not(:disabled):not(.active) {
  background: var(--background-100);
  color: var(--text-900);
  border-color: var(--background-400);
  transform: translateY(-1px);
}
.page-btn.active {
  background: var(--apple-primary);
  border-color: var(--apple-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,102,204,.28);
}
.page-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.page-arrow {
  font-size: 1.05rem;
  line-height: 1;
}
.page-ellipsis {
  border: none;
  background: none;
  color: var(--text-400);
  cursor: default;
  min-width: 20px;
}
.page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-600);
  margin-left: 10px;
  white-space: nowrap;
}
.page-size-select {
  height: 32px;
  border: 1px solid var(--apple-border);
  border-radius: 8px;
  background: var(--background-50);
  color: var(--text-800);
  font-size: 0.82rem;
  padding: 0 8px;
  cursor: pointer;
  outline: none;
}
.page-size-select:focus {
  border-color: var(--apple-ring);
  box-shadow: 0 0 0 3px rgba(0,102,204,.15);
}

/* 看板状态点击穿透 */
.status-link {
  color: var(--apple-primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.status-link:hover {
  color: #0058b0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.status-link::after {
  content: '→';
  margin-left: 4px;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.status-link:hover::after {
  opacity: 1;
  transform: translateX(1px);
}
.td-zero {
  color: var(--text-300);
}
.status-modal-table {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
}
.status-modal-table .data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* 状态弹窗：工具栏（全选 + 一键催办）与勾选列 */
.status-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.status-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.check-all-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-600);
  cursor: pointer;
  white-space: nowrap;
}
.check-all-label input,
.remind-check {
  accent-color: var(--apple-primary);
  cursor: pointer;
}
.status-modal-table .check-th,
.status-modal-table .check-cell {
  width: 36px;
  text-align: center;
}
.status-modal-table .check-cell {
  padding: 0;
}

/* 评审驳回：去向单选 */
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-600);
}
.radio-inline input {
  margin: 0;
  accent-color: var(--apple-primary);
}

/* 模板配置：开关（允许员工编辑 / 设为默认模板） */
.edit-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.edit-switch-text {
  font-size: 0.82rem;
  color: var(--text-600);
}
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.switch .switch-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch .switch-track {
  position: absolute;
  inset: 0;
  background: var(--border, #d1d5db);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.switch .switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.switch .switch-input:checked + .switch-track {
  background: var(--apple-primary, #2f69fd);
}
.switch .switch-input:checked + .switch-track::after {
  transform: translateX(16px);
}
