*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2396ED;
  --primary-light: #E8F4FF;
  --success: #36D399;
  --warning: #FF9F43;
  --danger: #F53F3F;
  --text-primary: #1D2129;
  --text-secondary: #6E7681;
  --bg-page: #F7F8FA;
  --bg-card: #FFFFFF;
  --radius-card: 20px;
  --radius-btn: 20px;
  --shadow-card: 0 4px 24px rgba(29, 33, 41, 0.06);
  --sidebar-w: 220px;
  --topbar-h: 56px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.admin-layout { display: flex; min-height: 100vh; max-width: 1440px; margin: 0 auto; background: var(--bg-page); box-shadow: 0 0 80px rgba(29,33,41,0.08); }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-card);
  border-right: 1px solid rgba(110,118,129,0.08);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; font-size: 16px; font-weight: 700; color: var(--text-primary);
  border-bottom: 1px solid rgba(110,118,129,0.08);
}
.brand-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #1A7FD4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: block; padding: 11px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; transition: all 0.15s;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: var(--bg-card);
  border-bottom: 1px solid rgba(110,118,129,0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; flex-shrink: 0;
}
.breadcrumb { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.admin-name { color: var(--text-secondary); }
.logout { color: var(--primary); text-decoration: none; font-weight: 500; cursor: pointer; }

.content { flex: 1; padding: 24px; overflow-y: auto; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-card);
  padding: 20px 22px; box-shadow: var(--shadow-card);
}
.stat-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.stat-value.primary { color: var(--primary); }
.stat-value.warning { color: var(--warning); }
.stat-sub { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  background: var(--bg-card); border-radius: var(--radius-card);
  padding: 20px 22px; box-shadow: var(--shadow-card);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.link { font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 500; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-actions { display: flex; gap: 10px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); padding: 10px 12px;
  border-bottom: 1px solid rgba(110,118,129,0.08);
}
.data-table td {
  font-size: 14px; color: var(--text-primary); padding: 14px 12px;
  border-bottom: 1px solid rgba(110,118,129,0.06);
}
.data-table tbody tr:hover td { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }
.money { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary); }

.tag {
  display: inline-flex; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag-done { background: rgba(54,211,153,0.12); color: var(--success); }
.tag-active { background: var(--primary); color: #fff; }
.tag-pending { background: var(--warning); color: #fff; }
.tag-disabled { background: #F2F3F5; color: var(--text-secondary); }

.btn-primary {
  padding: 10px 22px; border: none; border-radius: var(--radius-btn);
  background: linear-gradient(135deg, #2396ED, #1A7FD4);
  color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 12px rgba(35,150,237,0.25);
}
.btn-secondary {
  padding: 10px 22px; border: 1.5px solid rgba(35,150,237,0.3);
  border-radius: var(--radius-btn); background: var(--bg-card);
  color: var(--primary); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-text {
  border: none; background: none; color: var(--primary);
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-text-warn { border: none; background: none; color: var(--warning); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-text-danger { border: none; background: none; color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px;
}
.search-input {
  padding: 9px 16px; border-radius: 12px; border: 1px solid rgba(110,118,129,0.2);
  font-size: 14px; font-family: inherit; width: 240px; outline: none;
}
.search-input:focus { border-color: var(--primary); }

.form-card {
  background: var(--bg-card); border-radius: var(--radius-card);
  padding: 24px; box-shadow: var(--shadow-card); max-width: 640px;
}
.form-row { margin-bottom: 20px; }
.form-row label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 11px 16px; border-radius: 12px;
  border: 1px solid rgba(110,118,129,0.2); font-size: 14px;
  font-family: inherit; color: var(--text-primary); outline: none;
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-row input:focus, .form-row textarea:focus { border-color: var(--primary); }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }

.form-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.form-hint code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-page);
  font-size: 12px;
  color: var(--primary);
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(29,33,41,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 500;
}
.modal {
  width: 440px; background: var(--bg-card); border-radius: var(--radius-card);
  padding: 28px; box-shadow: 0 24px 80px rgba(29,33,41,0.2);
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text-primary); }
.modal-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }

.filter-tabs { display: flex; gap: 8px; }
.filter-tab {
  padding: 7px 16px; border-radius: 20px; border: none;
  background: var(--bg-page); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.filter-tab.active { background: var(--primary); color: #fff; }

.coach-avatar-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--primary-light);
  display: block;
}
.coach-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #E8F4FF, #D6EBFF);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--primary-light);
  flex-shrink: 0;
}
.avatar-preview.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}
.avatar-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.avatar-upload-actions input[type="file"] {
  font-size: 13px;
  max-width: 220px;
}
.avatar-upload-hint {
  font-size: 12px;
  color: var(--text-secondary);
}
.avatar-remove-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
