:root {
  color-scheme: light;
  --ink: #17164a;
  --muted: #7e87b5;
  --muted-strong: #59618f;
  --line: #e4e6f4;
  --surface: rgba(255, 255, 255, .86);
  --surface-strong: #fff;
  --canvas: #f4f4ff;
  --accent: #5367f5;
  --accent-soft: #eef0ff;
  --green: #238a68;
  --green-soft: #e8f8f1;
  --orange: #b56c2c;
  --orange-soft: #fff3e6;
  --red: #c64e5b;
  --red-soft: #fff0f2;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { min-width: 1080px; margin: 0; background: linear-gradient(135deg, #f6f6ff 0%, #eceeff 100%); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(83, 103, 245, .22); outline-offset: 2px; }

.login-view { display: grid; min-height: 100vh; place-items: center; padding: 32px; background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.85), transparent 42%), linear-gradient(135deg, #f6f6ff 0%, #eceeff 100%); }
.login-card { width: min(430px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.9); border-radius: 26px; background: rgba(255,255,255,.84); box-shadow: 0 26px 70px rgba(46,48,112,.14); }
.login-brand { padding: 0; margin-bottom: 48px; }
.login-card h1 { margin-top: 8px; font-size: 32px; }
.login-copy { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-form { display: grid; gap: 16px; margin-top: 26px; }
.login-form label { display: grid; gap: 7px; color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.login-form input { width: 100%; padding: 13px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfbff; font-size: 14px; font-weight: 400; }
.login-form .primary-button { width: 100%; margin-top: 4px; }
.login-hint { min-height: 20px; margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { display: flex; width: 248px; flex: 0 0 248px; flex-direction: column; padding: 30px 18px 24px; border-right: 1px solid rgba(255, 255, 255, .72); background: rgba(255, 255, 255, .62); backdrop-filter: blur(24px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { color: var(--ink); font-size: 16px; letter-spacing: .02em; }
.brand-lockup span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #697bff, #5367f5); box-shadow: 0 10px 20px rgba(83, 103, 245, .22); font-size: 20px; font-weight: 800; }
.side-nav { display: grid; gap: 8px; margin-top: 56px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; color: var(--muted-strong); font-size: 14px; text-decoration: none; }
.nav-item:hover { background: rgba(238, 240, 255, .8); color: var(--accent); }
.nav-item.active { color: var(--accent); background: #fff; box-shadow: 0 9px 22px rgba(87, 91, 164, .08); font-weight: 700; }
.nav-icon { width: 20px; color: currentColor; font-size: 17px; text-align: center; }
.sidebar-footer { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px 10px; border: 1px solid rgba(83, 103, 245, .12); border-radius: 14px; background: rgba(255, 255, 255, .62); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: var(--ink); font-size: 12px; }
.sidebar-footer small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.connection-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 4px; border-radius: 50%; background: #f2b65e; box-shadow: 0 0 0 4px rgba(242, 182, 94, .15); }

.main-content { width: min(1360px, calc(100vw - 248px)); margin: 0 auto; padding: 52px 58px 80px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin: 0; }
h1 { color: var(--ink); font-size: clamp(32px, 3vw, 44px); letter-spacing: -.04em; line-height: 1.1; }
h2 { color: var(--ink); font-size: 22px; letter-spacing: -.025em; }
.topbar-copy { margin-top: 12px; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.icon-button, .close-button { display: grid; place-items: center; border: 0; color: var(--muted-strong); background: transparent; }
.icon-button { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .74); box-shadow: 0 6px 16px rgba(87, 91, 164, .08); font-size: 22px; }
.icon-button:hover { color: var(--accent); background: #fff; }
.admin-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #fff; background: #c0baf7; font-size: 14px; font-weight: 700; }
.logout-button { min-height: 38px; padding: 0 12px; font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 42px; }
.stat-card { padding: 19px 20px; border: 1px solid rgba(255, 255, 255, .86); border-radius: 18px; background: var(--surface); box-shadow: 0 12px 26px rgba(87, 91, 164, .07); }
.stat-card span, .stat-card strong { display: block; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { margin-top: 10px; color: var(--ink); font-size: 30px; letter-spacing: -.04em; }
.stat-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.stat-card.is-accent strong { color: var(--accent); }
.stat-card.is-warn strong { color: var(--orange); }
.stat-card.is-good strong { color: var(--green); }

.panel { margin-top: 24px; padding: 28px; border: 1px solid rgba(255, 255, 255, .88); border-radius: 24px; background: var(--surface); box-shadow: 0 18px 42px rgba(87, 91, 164, .08); }
.panel-heading, .toolbar, .form-actions, .drawer-header, .modal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading { align-items: flex-end; }
.primary-button, .secondary-button { min-height: 42px; padding: 0 17px; border: 0; border-radius: 12px; font-size: 13px; font-weight: 700; }
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 9px 18px rgba(83, 103, 245, .2); }
.primary-button:hover { background: #4458e9; }
.secondary-button { color: var(--muted-strong); background: var(--accent-soft); }
.secondary-button:hover { color: var(--accent); background: #e2e5ff; }
.toolbar { justify-content: flex-start; margin-top: 26px; padding: 12px; border-radius: 16px; background: #f8f8ff; }
.search-box { display: flex; min-width: 320px; flex: 1; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); }
.search-box input { width: 100%; height: 40px; border: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input:focus { outline: 0; }
.select-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: 12px; }
.select-box select { height: 40px; border: 0; color: var(--ink); background: transparent; font-size: 13px; }
.select-box select:focus { outline: 0; }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.coach-table-wrap { overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.coach-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.coach-table th { padding: 14px 16px; color: var(--muted); background: #fafaff; font-size: 11px; font-weight: 600; text-align: left; }
.coach-table td { padding: 16px; border-top: 1px solid #f0f1fa; color: var(--muted-strong); font-size: 13px; vertical-align: middle; }
.coach-table th:nth-child(1) { width: 26%; }.coach-table th:nth-child(2) { width: 19%; }.coach-table th:nth-child(3) { width: 20%; }.coach-table th:nth-child(4) { width: 13%; }.coach-table th:nth-child(5) { width: 11%; }.coach-table th:nth-child(6) { width: 11%; }
.coach-row { cursor: pointer; transition: background .16s ease; }.coach-row:hover { background: #fafaff; }
.coach-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coach-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; overflow: hidden; border-radius: 14px; color: var(--accent); background: #e9ebff; font-weight: 800; }
.coach-avatar img { width: 100%; height: 100%; object-fit: cover; }
.coach-name, .coach-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.coach-name { color: var(--ink); font-weight: 700; }.coach-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.cell-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 99px; color: var(--muted-strong); background: #f0f1fa; font-size: 11px; font-weight: 700; }.status-pill.pending { color: var(--orange); background: var(--orange-soft); }.status-pill.approved { color: var(--green); background: var(--green-soft); }.status-pill.rejected, .status-pill.suspended { color: var(--red); background: var(--red-soft); }
.row-action { padding: 6px 8px; border: 0; border-radius: 8px; color: var(--accent); background: transparent; font-size: 12px; font-weight: 700; }.row-action:hover { background: var(--accent-soft); }
.empty-state { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 8px; color: var(--muted); font-size: 13px; text-align: center; }.empty-state strong { color: var(--ink); }.empty-icon { color: #b1b7e7; font-size: 38px; }

.drawer-backdrop, .modal-backdrop { position: fixed; z-index: 10; inset: 0; background: rgba(23, 22, 74, .2); backdrop-filter: blur(3px); }.detail-drawer { position: fixed; z-index: 11; top: 0; right: 0; bottom: 0; width: min(470px, 100vw); overflow-y: auto; padding: 30px; background: #fff; box-shadow: -20px 0 50px rgba(46, 48, 112, .16); transform: translateX(105%); visibility: hidden; transition: transform .24s ease, visibility 0s linear .24s; }.detail-drawer.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }.drawer-header, .modal-header { align-items: flex-start; }.close-button { width: 34px; height: 34px; border-radius: 10px; font-size: 24px; }.close-button:hover { color: var(--accent); background: var(--accent-soft); }.drawer-body { margin-top: 30px; }.detail-hero { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 17px; background: var(--accent-soft); }.detail-avatar { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 19px; }.detail-name { color: var(--ink); font-size: 21px; font-weight: 800; }.detail-id { margin-top: 5px; color: var(--muted); font-size: 11px; }.detail-section { margin-top: 24px; }.detail-section h3 { margin: 0 0 11px; color: var(--ink); font-size: 13px; }.detail-section p { color: var(--muted-strong); font-size: 13px; line-height: 1.7; }.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }.tag { padding: 6px 9px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }.detail-actions { display: grid; gap: 10px; margin-top: 30px; }.danger-button { color: var(--red); background: var(--red-soft); }

.coach-modal { position: fixed; z-index: 21; top: 50%; left: 50%; width: min(590px, calc(100vw - 40px)); padding: 28px; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(46, 48, 112, .22); transform: translate(-50%, -50%); }.coach-form { display: grid; gap: 15px; margin-top: 26px; }.coach-form label { display: grid; gap: 7px; color: var(--muted-strong); font-size: 12px; font-weight: 700; }.coach-form input, .coach-form select, .coach-form textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fbfbff; font-size: 13px; font-weight: 400; }.coach-form textarea { min-height: 90px; resize: vertical; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.form-grid-small { grid-template-columns: 1fr 1fr; }.form-actions { justify-content: flex-end; margin-top: 8px; }
.toast { position: fixed; z-index: 30; right: 28px; bottom: 28px; max-width: 360px; padding: 12px 16px; border-radius: 11px; color: #fff; background: #24235e; box-shadow: 0 12px 30px rgba(23, 22, 74, .2); font-size: 13px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }.toast.show { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 1120px) { .main-content { padding-right: 30px; padding-left: 30px; } }
