:root {
  --bg: #f4f6f3;
  --bg-accent: #eef4ef;
  --card: #ffffff;
  --text: #1f2a24;
  --muted: #6d7a71;
  --primary: #2f7d6f;
  --secondary: #ffb84a;
  --border: #e1e7e2;
  --danger: #f7e1e1;
  --shadow: 0 10px 30px rgba(38, 54, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #f8fbf7 0%, var(--bg) 55%, #eef1ea 100%);
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef6f2 0%, #f7f3e9 100%);
}

.login-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 18px;
  padding: 28px 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 8px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.login-form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 20px;
  background: #0f3f36;
  color: #f1f7f4;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 20px;
}

.brand-title {
  font-size: 16px;
  font-weight: 600;
}

.brand-sub {
  font-size: 13px;
  opacity: 0.7;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: #d7e6df;
  padding: 10px 12px;
  border-radius: 10px;
  transition: 0.2s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  opacity: 0.6;
  display: grid;
  gap: 8px;
}

.logout-link {
  font-size: 12px;
  color: #d7e6df;
  text-decoration: none;
}

.logout-link:hover {
  color: #fff;
}

.main {
  padding: 32px 36px 48px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.note-panel {
  padding: 12px 16px;
  margin-bottom: 12px;
}

.note-panel p {
  margin: 4px 0;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.page-actions.stacked {
  flex-direction: column;
  align-items: flex-end;
}

.page-actions.stacked .action-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

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

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

.stat-card.accent {
  background: #fff8ec;
}

.stat-link {
  text-decoration: none;
  color: inherit;
}

.stat-link .stat-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-link .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(26, 39, 30, 0.12);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  margin-top: 6px;
}

.panel {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.focus-panel h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.focus-panel .focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.focus-panel .focus-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.focus-panel .focus-card ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
}

.edit-form {
  display: grid;
  gap: 16px;
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.edit-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.edit-field em {
  color: #c54d4d;
  margin-left: 4px;
  font-style: normal;
}

.edit-field input,
.edit-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}

.edit-field.full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.topbar {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.topbar-left h1 {
  margin: 0;
  font-size: 24px;
}

.topbar-center {
  display: flex;
  justify-content: center;
}

.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.search-form input[type="text"] {
  min-width: 160px;
  width: 180px;
  border: none;
  outline: none;
}

.search-form .btn {
  padding: 6px 12px;
  font-size: 14px;
}

.search-popover {
  margin-bottom: 16px;
  position: relative;
  z-index: 3;
}

.profile-grid {
  column-count: 2;
  column-gap: 16px;
}

.profile-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  break-inside: avoid;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf7 100%);
}

.profile-card-danger {
  border-color: #f0c0c0;
  background: #fff7f7;
}

.profile-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: #f2f7f4;
  border-radius: 12px;
  padding: 10px 12px;
}

.profile-id {
  font-size: 12px;
  color: var(--muted);
}

.profile-score {
  display: grid;
  justify-items: end;
  font-size: 12px;
  color: var(--muted);
}

.profile-score strong {
  font-size: 18px;
  color: var(--primary);
}

.profile-score em {
  font-style: normal;
  font-size: 11px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f7d6f, #6a9b8a);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 18px;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.metric {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.metric strong {
  font-size: 16px;
  color: var(--text);
}

.profile-chart {
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #f7faf7;
}

.profile-chart .line-chart {
  height: 120px;
}

.profile-notes {
  font-size: 13px;
  color: var(--muted);
}

.profile-risk {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.import-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.import-form input[type="file"] {
  min-width: 180px;
}

@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .topbar-center {
    order: 2;
  }
  .topbar-right {
    order: 3;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .search-form {
    width: 100%;
    justify-content: space-between;
  }
  .search-form input[type="text"] {
    min-width: 0;
    width: 100%;
  }
  .profile-grid {
    column-count: 1;
  }
  .trend-layout {
    grid-template-columns: 1fr;
  }
  .trend-legend {
    grid-auto-flow: column;
    justify-content: start;
  }
}

.tag {
  font-size: 12px;
  border-radius: 8px;
  padding: 4px 8px;
  background: #eef4ef;
  color: #2f7d6f;
}

.tag.warn {
  background: #fff2d6;
  color: #8a5b00;
}

.tag.danger {
  background: #f7e1e1;
  color: #8a2b2b;
}

.chart-note {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.stat-card[data-tooltip] {
  position: relative;
}

.stat-card[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px);
  background: #1f2a24;
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 240px;
  white-space: normal;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.stat-card[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: calc(100% + 2px);
  border-width: 6px;
  border-style: solid;
  border-color: #1f2a24 transparent transparent transparent;
  z-index: 2;
}

.has-tooltip {
  position: relative;
  cursor: help;
}

.has-tooltip .help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: #eef4ef;
  color: #2f7d6f;
  font-size: 11px;
  font-weight: 600;
}

.has-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: #1f2a24;
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  max-width: 220px;
  white-space: normal;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: #f9fbf8;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto 12px;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #f9fbf8;
}

.donut-annotated {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 12px;
}

.donut-annotated .donut {
  position: absolute;
  top: 30px;
  left: 30px;
  margin: 0;
}

.donut-labels {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.donut-labels line {
  stroke: #9fb8a5;
  stroke-width: 1;
}

.donut-labels text {
  font-size: 11px;
  fill: var(--text);
}

.legend {
  display: grid;
  gap: 6px;
  font-size: 13px;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 6px;
}

.trend-layout {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: start;
}

.trend-legend {
  display: grid;
  gap: 12px;
  font-size: 12px;
  color: var(--text);
}

.trend-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trend-chart .line-chart {
  height: 240px;
}

.line-chart {
  width: 100%;
  height: 200px;
}

.line-chart polyline {
  fill: none;
  stroke-width: 2;
}

.line-chart circle {
  stroke: #fff;
  stroke-width: 1;
}

.line-chart text {
  font-size: 10px;
  fill: #3a4b41;
}

.line-chart text.line-axis {
  fill: var(--muted);
}

.line-chart text.line-value {
  font-size: 10px;
  font-weight: 600;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
}

.bar-chart.slim {
  gap: 10px;
  height: 120px;
}

.bar-chart.slim .bar {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, #6aa596 0%, #2f7d6f 100%);
}

.bar-chart.slim .bar-item {
  gap: 4px;
}

.bar-chart.slim .bar-label {
  font-size: 10px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar-value {
  font-size: 11px;
  color: var(--muted);
}

.bar {
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, #2f7d6f 0%, #6a9b8a 100%);
  min-height: 8px;
}

.bar-label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  max-width: 90px;
  line-height: 1.2;
  white-space: nowrap;
}

.track-chart {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.track-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.track-label {
  color: var(--text);
  word-break: break-word;
}

.track-bar {
  height: 10px;
  background: #e4eee8;
  border-radius: 999px;
  overflow: hidden;
}

.track-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f7d6f 0%, #6a9b8a 100%);
  border-radius: 999px;
}

.track-value {
  color: var(--muted);
  text-align: right;
}

.priority-chart {
  display: grid;
  gap: 12px;
}

.priority-row {
  display: grid;
  grid-template-columns: 40px 1fr 90px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

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

.priority-bar {
  height: 10px;
  background: #e4eee8;
  border-radius: 999px;
  overflow: hidden;
}

.priority-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f7d6f 0%, #6a9b8a 100%);
  border-radius: 999px;
}

.priority-row[data-level="高"] .priority-fill {
  background: linear-gradient(90deg, #2f7d6f 0%, #5fa391 100%);
}

.priority-row[data-level="中"] .priority-fill {
  background: linear-gradient(90deg, #ffb84a 0%, #ffd08a 100%);
}

.priority-row[data-level="低"] .priority-fill {
  background: linear-gradient(90deg, #9fb1a8 0%, #c3d1c9 100%);
}

.priority-value {
  color: var(--muted);
  text-align: right;
}

.filter-panel {
  padding: 16px;
}

.filter-form {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: visible;
  padding-bottom: 4px;
}

.filter-form input[type="text"],
.filter-form select {
  min-width: 80px;
  max-width: 140px;
}

.filter-form .track-select {
  min-width: 110px;
  max-width: 160px;
}

.coach-note {
  max-width: 560px;
  line-height: 1.5;
}

.coach-filter {
  flex-wrap: wrap;
}

.coach-filter input[type="text"],
.coach-filter select {
  min-width: 80px;
  max-width: 120px;
}

.coach-filter .track-select {
  min-width: 110px;
  max-width: 150px;
}

.tag-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fafbf9;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4ef;
  font-size: 12px;
  color: #2f7d6f;
}

.check-chip input {
  accent-color: #2f7d6f;
}

.coach-filter .btn {
  padding: 6px 12px;
}

@media (max-width: 1200px) {
  .filter-form {
    flex-wrap: wrap;
  }
}

input[type="text"],
input[type="file"],
input[type="url"],
input[type="password"],
input[type="number"],
select,
textarea {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  min-width: 140px;
  font-family: inherit;
}

textarea {
  width: 100%;
  resize: vertical;
}

.import-form {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.import-form.compact {
  margin-top: 0;
}

.import-form.compact input[type="file"] {
  min-width: 140px;
}

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}

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

.btn.secondary {
  background: var(--secondary);
  color: #3b2d0a;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.badge {
  padding: 4px 8px;
  border-radius: 8px;
  background: #e9f5f0;
  color: #1f5b50;
  font-size: 12px;
}

.badge.success {
  background: #e7f4ef;
  color: #1f5b50;
}

.badge.warn {
  background: #fff3d6;
  color: #8f5a0a;
}

.badge.neutral {
  background: #eef2f1;
  color: #3f4d46;
}

.badge.priority {
  font-weight: 600;
}

.badge.priority-high {
  background: #e2f4ef;
  color: #1f5b50;
}

.badge.priority-mid {
  background: #fff2d6;
  color: #8f5a0a;
}

.badge.priority-low {
  background: #eef2f1;
  color: #3f4d46;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f1;
  color: #3f4d46;
  font-size: 12px;
  font-weight: 600;
}

.risk-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa7a1;
}

.risk-badge.safe {
  background: #e7f4ef;
  color: #1f5b50;
}

.risk-badge.safe::before {
  background: #2f7d6f;
}

.risk-badge.danger {
  background: #fdecec;
  color: #8a2b2b;
}

.risk-badge.danger::before {
  background: #d15555;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

.notice {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f1f6f4;
  color: #1f5b50;
  font-weight: 600;
}

.notice.success {
  background: #eaf6f1;
  color: #2f7d6f;
}

.notice.warn {
  background: #fff5df;
  color: #9a5c0a;
}

.notice.error {
  background: #fdecec;
  color: #8a2b2b;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  width: min(720px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body {
  margin-top: 12px;
  overflow-y: auto;
}

.btn-close {
  padding: 4px 10px;
  font-size: 13px;
}

.import-errors {
  margin: 8px 0 0;
  padding-left: 18px;
  color: inherit;
  font-weight: 500;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  min-width: 980px;
}

.table-wrap.detail-table {
  overflow-x: hidden;
}

.table-wrap.detail-table table {
  min-width: 0;
  table-layout: fixed;
}

.table-wrap.detail-table th,
.table-wrap.detail-table td {
  text-align: left;
}

.table-wrap.detail-table th:nth-child(1),
.table-wrap.detail-table td:nth-child(1) {
  width: 110px;
}

.table-wrap.detail-table th:nth-child(3),
.table-wrap.detail-table td:nth-child(3) {
  width: 120px;
}

.table-wrap.detail-table th:nth-child(4),
.table-wrap.detail-table td:nth-child(4) {
  width: 100px;
}

.table-wrap.detail-table td:nth-child(2) {
  width: auto;
  word-break: break-word;
}

.table-wrap.coach-table {
  overflow-x: hidden;
}

.table-wrap.coach-table table {
  min-width: 0;
  table-layout: fixed;
}


.table-wrap.coach-table th:nth-child(1),
.table-wrap.coach-table td:nth-child(1) {
  width: 80px;
}

.table-wrap.coach-table th:nth-child(2),
.table-wrap.coach-table td:nth-child(2) {
  width: 100px;
}

.table-wrap.coach-table th:nth-child(3),
.table-wrap.coach-table td:nth-child(3) {
  width: 100px;
}

.table-wrap.coach-table th:nth-child(4),
.table-wrap.coach-table td:nth-child(4) {
  width: 180px;
}

.table-wrap.coach-table th:nth-child(5),
.table-wrap.coach-table td:nth-child(5) {
  width: 90px;
}

.table-wrap.coach-table th:nth-child(6),
.table-wrap.coach-table td:nth-child(6) {
  width: 90px;
}

.table-wrap.coach-table th:nth-child(7),
.table-wrap.coach-table td:nth-child(7) {
  width: 70px;
}

.table-wrap.coach-table th:nth-child(8),
.table-wrap.coach-table td:nth-child(8) {
  width: 60px;
}

.table-wrap.coach-table th:nth-child(9),
.table-wrap.coach-table td:nth-child(9) {
  width: 60px;
}

.table-wrap.coach-table th:nth-child(10),
.table-wrap.coach-table td:nth-child(10) {
  width: 60px;
}

.table-wrap.coach-table th:nth-child(11),
.table-wrap.coach-table td:nth-child(11) {
  width: 60px;
}

.table-compact th,
.table-compact td {
  padding: 8px 6px;
  font-size: 13px;
  line-height: 1.3;
}

.cell-nickname {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-tags {
  max-width: 260px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.coach-table .cell-tags {
  max-width: 180px;
}

th,
td {
  text-align: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.row-danger {
  background: var(--danger);
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.page-jump {
  display: flex;
  gap: 6px;
  align-items: center;
}

.page-jump input[type="number"] {
  width: 90px;
  min-width: 90px;
}

.pagination-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.page-link {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
}

.page-link.active {
  background: #2f7d6f;
  color: #fff;
  border-color: #2f7d6f;
}

.detail-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fbfbfb;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-title {
  font-size: 16px;
  font-weight: 600;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(320px, 4fr);
  gap: 18px;
  align-items: start;
}

.detail-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-crm {
  min-width: 0;
}

.crm-sticky {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 0;
}

.detail-main .panel,
.detail-crm .panel {
  margin-bottom: 0;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.hero-main {
  display: flex;
  gap: 16px;
  align-items: center;
}

.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.hero-info {
  display: grid;
  gap: 6px;
}

.hero-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  align-items: center;
}

.hero-special,
.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.coach-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.coach-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  white-space: pre-wrap;
}

.coach-item .label {
  color: var(--muted);
  font-size: 12px;
}

.coach-item.full {
  grid-column: 1 / -1;
}

.hero-special .label {
  color: var(--muted);
}

.hero-alert {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #f3c3c3;
  background: #fbe9e9;
  font-size: 13px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.rating-stamp {
  padding: 8px 14px;
  border-radius: 12px;
  border: 2px solid #2f7d6f;
  color: #2f7d6f;
  font-weight: 700;
  transform: rotate(-6deg);
  background: rgba(47, 125, 111, 0.08);
  font-size: 13px;
}

.rating-stamp.good {
  border-color: #2f7d6f;
  color: #2f7d6f;
}

.rating-stamp.mid {
  border-color: #d28a2b;
  color: #a0600f;
  background: rgba(255, 200, 114, 0.2);
}

.rating-stamp.low {
  border-color: #8e9b94;
  color: #6a756f;
  background: rgba(170, 178, 172, 0.18);
}

.rating-stamp.danger {
  border-color: #c84b4b;
  color: #a12f2f;
  background: rgba(248, 210, 210, 0.5);
}

.status-tag {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: #e9f5f0;
  color: #1f5b50;
  font-weight: 600;
}

.status-tag.warn {
  background: #fff2d6;
  color: #8f5a0a;
}

.status-tag.danger {
  background: #f7e1e1;
  color: #8a2b2b;
}

.btn-copy {
  padding: 4px 10px;
  font-size: 12px;
}

.hero-intro {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbfbfb;
  font-size: 13px;
}

.hero-intro .label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-intro p {
  margin: 0;
  white-space: pre-wrap;
}

.info-section {
  margin-top: 12px;
}

.info-section h3 {
  margin: 8px 0 10px;
  font-size: 14px;
  color: #203a30;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 16px;
}

.info-item {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fbfbfb;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.info-item .label {
  color: var(--muted);
  font-size: 12px;
}

.info-item .value {
  white-space: pre-wrap;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.viz-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #fbfbfb;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.timeline-period {
  font-weight: 600;
  color: #2f7d6f;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.timeline-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6f2;
  color: #2f7d6f;
  font-size: 12px;
}

.timeline-result {
  font-weight: 600;
  color: #2f7d6f;
}

.timeline-detail {
  font-size: 12px;
  color: var(--muted);
}

.radar-chart {
  width: 100%;
  max-width: 280px;
  margin: 8px auto 0;
  display: block;
  overflow: visible;
}

.radar-grid {
  fill: none;
  stroke: #e4eee8;
  stroke-width: 1;
}

.radar-axis {
  stroke: #e4eee8;
  stroke-width: 1;
}

.radar-shape {
  fill: rgba(47, 125, 111, 0.2);
  stroke: #2f7d6f;
  stroke-width: 2;
}

.radar-dot {
  fill: #2f7d6f;
}

.radar-axis-label {
  font-size: 11px;
  fill: var(--muted);
}

.radar-axis-value {
  font-size: 10px;
  fill: #2f7d6f;
  font-weight: 600;
}

.radar-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
}

.radar-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.trend-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.trend-chart svg {
  width: 100%;
  height: 180px;
}

.trend-chart polyline {
  fill: none;
  stroke: #2f7d6f;
  stroke-width: 2;
}

.trend-chart circle {
  fill: #2f7d6f;
}

.trend-label {
  font-size: 10px;
  fill: #2f7d6f;
}

.rating-chart {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rating-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding-top: 4px;
  height: 200px;
}

.rating-canvas {
  flex: 1;
  min-width: 0;
}

.rating-canvas svg {
  width: 100%;
  height: 200px;
}

.rating-canvas polyline {
  fill: none;
  stroke: #2f7d6f;
  stroke-width: 2;
}

.rating-canvas circle {
  fill: #2f7d6f;
}

.role-dot {
  fill: #8a6b2f;
}

.role-label {
  font-size: 9px;
  fill: #8a6b2f;
}

.timeline-chart svg {
  width: 100%;
  height: 200px;
}

.timeline-chart polyline {
  fill: none;
  stroke: #2f7d6f;
  stroke-width: 2;
}

.timeline-chart circle {
  fill: #2f7d6f;
}

.detail-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.crm-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.crm-embed .crm-iframe {
  width: 100%;
  min-height: 640px;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

@media (min-width: 1400px) {
  .coach-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.remark-panel {
  display: grid;
  gap: 12px;
}

.remark-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.remark-bar {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fbfbfb;
}

.remark-bar span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remark-form textarea {
  width: 100%;
}

.crm-feed {
  display: grid;
  gap: 10px;
  font-size: 13px;
  padding-left: 18px;
}

.crm-feed li {
  display: grid;
  gap: 4px;
}

.crm-time {
  color: var(--muted);
  font-size: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.timeline-label {
  min-width: 60px;
  color: var(--muted);
}

.timeline-rating {
  font-size: 16px;
}

.detail-note {
  padding: 8px 0;
  color: var(--muted);
}

details summary {
  cursor: pointer;
  color: var(--primary);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .crm-sticky {
    position: static;
    max-height: none;
  }
  .detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .timeline-item {
    grid-template-columns: 1fr;
  }
}
