/*
 * Coach dashboard (client template 2026-10-29) - page-team-status.php when the
 * viewer is the coach. Scoped .nct-db-*; loads after nct-coach.css.
 */
.nct-db { --db-blue: #1e6fe8; --db-blue-soft: #e8f0fe; --db-ink: #0f1b33; --db-muted: #5f6b80; --db-line: #e1e7f0; --db-green: #22b25a; --db-amber: #f5a623; --db-purple: #7a3ef0; --db-bg: #eef3fa; }

/* The dashboard replaces the page's focused column: full width, sidebar + main. */
body.nct-cp-mode .nct-team-status .nct-ct-wrap.nct-ct-join { max-width: none; width: 100%; padding: 0; }
body.nct-cp-mode .nct-team-status .nct-ct-join-inner { max-width: none; width: 100%; padding: 0; }
body.nct-cp-mode .nct-team-status .nct-ct-stack { display: none; }
body.nct-cp-mode .nct-db-legacy { display: none; }
.nct-db { display: grid; grid-template-columns: 232px 1fr; min-height: 80vh; background: var(--db-bg); color: var(--db-ink); font-size: 15px; }
.nct-db[hidden] { display: none; }

/* Sidebar */
.nct-db-side { position: relative; background: linear-gradient(180deg, #0b1a3a 0, #0c1430 100%); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; overflow: hidden; }
.nct-db-brand img { height: 40px; width: auto; display: block; margin: 4px 6px 6px; }
.nct-db-nav { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.nct-db-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: #dbe4f5; text-decoration: none; font-size: 16px; font-weight: 600; }
.nct-db-nav a svg { width: 22px; height: 22px; flex: 0 0 22px; }
.nct-db-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nct-db-nav a.is-active { background: var(--db-blue); color: #fff; box-shadow: 0 8px 20px rgba(30,111,232,0.35); }
.nct-db-side-art { flex: 1 1 auto; min-height: 220px; background: radial-gradient(60% 50% at 50% 90%, rgba(30,111,232,0.35) 0, rgba(30,111,232,0) 70%); }

/* Main column */
.nct-db-main { padding: 0 20px 28px; min-width: 0; }
.nct-db-head { position: relative; margin: 0 -20px 18px; padding: 22px 28px 18px; color: #fff; background: #0b1a3a var(--cp-hero, none) center / cover no-repeat; overflow: hidden; }
.nct-db-head::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,20,48,0.92) 0, rgba(8,20,48,0.7) 45%, rgba(8,20,48,0.35) 100%); }
.nct-db-head > * { position: relative; }
.nct-db-head-row { display: flex; align-items: center; gap: 18px; }
.nct-db-logo { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 16px; background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.35); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; overflow: hidden; position: relative; }
.nct-db-logo img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.nct-db-logo img[hidden] { display: none; }
.nct-db-logo-empty { color: #fff; opacity: .9; }
.nct-db-logo-empty svg { width: 30px; height: 30px; }
.nct-db-logo-empty[hidden] { display: none; }
.nct-db-logo-hint { font-size: 11px; font-weight: 700; color: #fff; text-align: center; line-height: 1.1; }
.nct-db-logo img:not([hidden]) ~ .nct-db-logo-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px; background: rgba(8,20,48,0.75); opacity: 0; transition: opacity .15s; }
.nct-db-logo:hover img:not([hidden]) ~ .nct-db-logo-hint { opacity: 1; }
.nct-db-head-title h1 { margin: 0; font-size: clamp(26px, 3vw, 40px); font-weight: 900; color: #fff; line-height: 1.05; text-transform: none; letter-spacing: -0.01em; }
.nct-db-head-title span { display: block; margin-top: 4px; font-size: 18px; color: #d9e3f7; }
.nct-db-coach { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nct-db-coach-avatar { width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--db-ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.nct-db-coach-name { display: flex; flex-direction: column; line-height: 1.2; }
.nct-db-coach-name strong { font-size: 16px; color: #fff; }
.nct-db-coach-name em { font-style: normal; font-size: 13px; color: #c8d4ec; }
.nct-db-head-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; font-size: 16px; }
.nct-db-strip-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.nct-db-strip-item svg { width: 22px; height: 22px; }
.nct-db-strip-item b { font-weight: 800; }
.nct-db-strip-item.is-ok svg { color: #35d07f; }
.nct-db-strip-item.is-wait svg { color: #ffb43a; }
.nct-db-strip-link { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 6px 6px 6px 12px; border-radius: 12px; background: rgba(8,20,48,0.75); border: 1px solid rgba(255,255,255,0.18); max-width: 100%; min-width: 0; }
.nct-db-strip-link i { width: 28px; height: 28px; border-radius: 8px; background: var(--db-blue); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; }
.nct-db-strip-link i svg { width: 16px; height: 16px; }
.nct-db-strip-link-label { font-weight: 700; white-space: nowrap; }
.nct-db-strip-link-url { font-size: 15px; color: #d9e3f7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* Buttons */
.nct-db-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.1; white-space: nowrap; }
.nct-db-btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nct-db-btn-sm { padding: 9px 14px; font-size: 14px; }
.nct-db-btn-primary { background: var(--db-blue); color: #fff; }
.nct-db-btn-primary:hover { background: #185cc4; color: #fff; }
.nct-db-btn-outline { background: #fff; color: var(--db-blue); border-color: #bcd0f3; }
.nct-db-btn-outline:hover { background: var(--db-blue-soft); color: var(--db-blue); }
.nct-db-btn-block { width: 100%; box-sizing: border-box; }
.nct-db-btn[disabled] { opacity: .6; cursor: default; }
.nct-db-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--db-blue); cursor: pointer; text-decoration: none; }
.nct-db-link:hover { text-decoration: underline; }

/* KPI tiles */
.nct-db-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 16px; }
.nct-db-tile { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--db-line); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.nct-db-tile > i, .nct-db-mini-head > i, .nct-db-fund > i { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.nct-db-tile > i svg, .nct-db-mini-head > i svg, .nct-db-fund > i svg { width: 28px; height: 28px; }
.nct-db .is-blue { background: var(--db-blue); } .nct-db .is-green { background: var(--db-green); } .nct-db .is-amber { background: var(--db-amber); } .nct-db .is-purple { background: var(--db-purple); } .nct-db .is-grey { background: #c5cedd; }
.nct-db-tile > div { min-width: 0; flex: 1 1 auto; }
.nct-db-tile span { display: block; font-size: 15px; color: var(--db-muted); }
.nct-db-tile b { display: block; font-size: 30px; font-weight: 900; line-height: 1.1; }
.nct-db-tile small { display: block; font-size: 13px; color: var(--db-muted); margin-top: 2px; }
.nct-db-bar { height: 8px; border-radius: 999px; background: #e3e9f3; overflow: hidden; margin: 6px 0 4px; }
.nct-db-bar > div { height: 100%; width: 0; background: var(--db-green); border-radius: 999px; transition: width .4s; }

/* Grid + cards */
.nct-db-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; }
.nct-db-col-main, .nct-db-col-side { min-width: 0; }
.nct-db-bottom > * { min-width: 0; }
.nct-db-card { background: #fff; border: 1px solid var(--db-line); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.nct-db-card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.nct-db-card-ico { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; background: var(--db-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.nct-db-card-ico svg { width: 26px; height: 26px; }
.nct-db-card-title { flex: 1 1 200px; }
.nct-db-card-head h2, .nct-db-mini-head h3 { margin: 0; font-size: 20px; font-weight: 800; text-transform: none; letter-spacing: 0; }
.nct-db-card-head p, .nct-db-mini-head p { margin: 2px 0 0; font-size: 14px; color: var(--db-muted); }
.nct-db-search { position: relative; display: inline-flex; align-items: center; }
.nct-db-search svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--db-muted); pointer-events: none; }
.nct-db-search input { width: 190px; padding: 10px 12px 10px 38px; border: 1px solid #cfd8e6; border-radius: 10px; font: inherit; font-size: 14px; }
.nct-db-card-actions { display: flex; gap: 8px; }

/* Player table */
.nct-db-table-wrap { overflow-x: auto; border: 1px solid var(--db-line); border-radius: 12px; }
.nct-db-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nct-db-table th { text-align: left; padding: 10px 12px; background: #f3f6fb; color: var(--db-muted); font-weight: 700; font-size: 13px; white-space: nowrap; border-bottom: 1px solid var(--db-line); }
.nct-db-table td { padding: 10px 12px; border-bottom: 1px solid var(--db-line); vertical-align: middle; }
.nct-db-table tr:last-child td { border-bottom: 0; }
.nct-db-table tr:hover td { background: #f8fafe; }
.nct-db-th-check, .nct-db-td-check { width: 34px; }
.nct-db-td-num { font-weight: 700; color: var(--db-muted); width: 40px; }
.nct-db-player { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.nct-db-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: var(--db-blue-soft); color: var(--db-blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; overflow: hidden; }
.nct-db-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nct-db-player b { display: block; font-size: 15px; }
.nct-db-player span { display: block; font-size: 12px; color: var(--db-muted); }
.nct-db-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.nct-db-pill svg { width: 14px; height: 14px; }
.nct-db-pill.is-ok { background: #e4f8ec; color: #167d3f; }
.nct-db-pill.is-wait { background: #fff2dc; color: #a35f00; }
.nct-db-pill.is-none { background: #eef1f6; color: var(--db-muted); }
.nct-db-pill.is-prod { background: #e9e2fb; color: #5b2bc0; }
.nct-db-thumb { width: 36px; height: 50px; border-radius: 5px; background: #eef1f6; object-fit: cover; display: block; }
.nct-db-td-actions { white-space: nowrap; text-align: right; }
.nct-db-mini-btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 16px; border-radius: 8px; border: 1px solid #bcd0f3; background: #fff; color: var(--db-blue); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-width: 78px; }
.nct-db-mini-btn:hover { background: var(--db-blue-soft); }
.nct-db-mini-btn[disabled] { opacity: .6; cursor: default; }
.nct-db-kebab { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.nct-db-kebab > button { width: 30px; height: 30px; border: 0; background: none; color: var(--db-muted); cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.nct-db-kebab > button:hover { background: #eef1f6; }
.nct-db-kebab > button svg { width: 18px; height: 18px; }
.nct-db-kebab-menu { position: absolute; right: 0; top: 100%; z-index: 4; min-width: 170px; background: #fff; border: 1px solid var(--db-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,27,51,0.15); padding: 6px; display: none; text-align: left; }
.nct-db-kebab.is-open .nct-db-kebab-menu { display: block; }
.nct-db-kebab-menu button, .nct-db-kebab-menu a { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--db-ink); cursor: pointer; border-radius: 8px; text-decoration: none; }
.nct-db-kebab-menu button:hover, .nct-db-kebab-menu a:hover { background: #f3f6fb; }
.nct-db-kebab-menu .is-danger { color: #c62828; }
.nct-db-empty { margin: 0; padding: 26px 16px; text-align: center; color: var(--db-muted); }
.nct-db-table-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.nct-db-table-foot:empty { display: none; }

/* Bottom row of mini cards */
.nct-db-bottom { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.nct-db-mini { margin-bottom: 0; padding: 16px; }
.nct-db-stack { display: grid; gap: 14px; align-content: start; }
.nct-db-stack .nct-db-mini { margin-bottom: 0; }
.nct-db-mini .nct-db-design-art { height: 110px; }
.nct-db-mini .nct-db-details > div { padding: 6px 0; font-size: 13px; }
.nct-db-mini-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.nct-db-mini-head > i { width: 40px; height: 40px; flex-basis: 40px; }
.nct-db-mini-head > i svg { width: 20px; height: 20px; }
.nct-db-mini-head h3 { font-size: 17px; }
.nct-db-mini-head .nct-db-link { margin-left: auto; white-space: nowrap; }
.nct-db-activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.nct-db-activity li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; color: var(--db-ink); }
.nct-db-activity li span { color: var(--db-muted); }
.nct-db-activity .is-empty { grid-template-columns: 1fr; color: var(--db-muted); }
.nct-db-orders { display: flex; gap: 10px; align-items: flex-start; }
.nct-db-orders dl { margin: 0; flex: 1 1 auto; display: grid; gap: 8px; }
.nct-db-orders dt { font-size: 20px; font-weight: 900; line-height: 1.1; }
.nct-db-orders dt.is-sm { font-size: 14px; font-weight: 700; }
.nct-db-orders dd { margin: 0; font-size: 12px; color: var(--db-muted); }
.nct-db-orders-art { display: flex; gap: 4px; flex: 0 0 auto; }
.nct-db-orders-art img { width: 38px; height: 54px; object-fit: cover; border-radius: 4px; box-shadow: 0 3px 8px rgba(0,0,0,0.18); }
.nct-db-orders-actions { margin-top: 12px; display: grid; gap: 8px; }
.nct-db-fund { display: flex; gap: 10px; align-items: flex-start; }
.nct-db-fund > i { width: 40px; height: 40px; flex-basis: 40px; }
.nct-db-fund > i svg { width: 20px; height: 20px; }
.nct-db-fund > div { flex: 1 1 auto; }
.nct-db-fund b { font-size: 22px; font-weight: 900; }
.nct-db-fund > div > span { font-size: 13px; color: var(--db-muted); }
.nct-db-fund small { font-size: 12px; color: var(--db-muted); }
.nct-db-fund-note { margin: 8px 0 12px; font-size: 12px; color: var(--db-muted); }
.nct-db-fund-note:empty { display: none; }
#db-support .nct-db-btn-block { margin-top: 8px; justify-content: flex-start; }

/* Right column */
.nct-db-progress { display: flex; align-items: center; gap: 16px; }
.nct-db-donut { --pct: 0; width: 150px; height: 150px; flex: 0 0 150px; border-radius: 50%; background: conic-gradient(var(--db-green) calc(var(--pct) * 1%), #e3e9f3 0); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; text-align: center; }
.nct-db-donut::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: #fff; }
.nct-db-donut > * { position: relative; }
.nct-db-donut b { font-size: 28px; font-weight: 900; line-height: 1; }
.nct-db-donut small { font-size: 13px; color: var(--db-ink); margin-top: 3px; }
.nct-db-donut em { font-style: normal; font-size: 11px; color: var(--db-muted); }
.nct-db-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; display: grid; gap: 8px; }
.nct-db-legend li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--db-line); border-radius: 10px; font-size: 14px; }
.nct-db-legend li i { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.nct-db-legend li b { margin-left: auto; font-weight: 800; }
.nct-db-share-row { display: flex; gap: 8px; margin-bottom: 12px; }
.nct-db-share-row input { flex: 1 1 auto; min-width: 0; padding: 11px 12px; border: 1px solid #cfd8e6; border-radius: 10px; font: inherit; font-size: 14px; background: #f8fafe; }
.nct-db-share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.nct-db-share-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 6px; border-radius: 12px; border: 1px solid #bcd0f3; background: var(--db-blue-soft); color: var(--db-blue); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.nct-db-share-btn svg { width: 26px; height: 26px; }
.nct-db-share-btn:hover { background: #d9e6fd; color: var(--db-blue); }
.nct-db-qr { text-align: center; margin: 4px 0 12px; }
.nct-db-qr[hidden] { display: none; }
.nct-db-qr img { width: 180px; height: 180px; display: block; margin: 0 auto 8px; border: 1px solid var(--db-line); border-radius: 10px; }
.nct-db-design { display: flex; flex-direction: column; gap: 12px; }
.nct-db-design-art { height: 120px; border-radius: 12px; background: #0b1a3a center / cover no-repeat; display: flex; align-items: flex-end; padding: 10px 12px; color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.nct-db-design .nct-db-btn { align-self: flex-start; }
.nct-db-details { margin: 0; display: grid; gap: 8px; }
.nct-db-details > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--db-line); font-size: 14px; }
.nct-db-details > div:last-child { border-bottom: 0; }
.nct-db-details dt { color: var(--db-muted); }
.nct-db-details dd { margin: 0; font-weight: 700; text-align: right; }
.nct-db-details-actions { display: grid; gap: 8px; margin-top: 10px; }
.nct-db-details-actions:empty { display: none; }

/* Notices from the coach tools (teams-status.js) surface here. */
body.nct-cp-mode #nct-coach-notice { display: none !important; }
.nct-db-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100002; background: #0f1b33; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-width: calc(100% - 32px); }
.nct-db-toast.is-error { background: #c62828; }

@media (max-width: 1280px) {
	.nct-db-tiles { grid-template-columns: repeat(3, 1fr); }
	.nct-db-bottom { grid-template-columns: 1fr 1fr; }
	.nct-db-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1024px) {
	.nct-db { grid-template-columns: 1fr; }
	.nct-db-side { flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; overflow-x: auto; }
	.nct-db-brand img { height: 28px; margin: 0 6px; }
	.nct-db-nav { flex-direction: row; gap: 2px; }
	.nct-db-nav a { padding: 8px 10px; font-size: 13px; gap: 6px; }
	.nct-db-nav a svg { width: 18px; height: 18px; }
	.nct-db-side-art { display: none; }
	.nct-db-grid { grid-template-columns: 1fr; }
	.nct-db-strip-link { margin-left: 0; width: 100%; }
	.nct-db-strip-link-url { max-width: none; flex: 1 1 auto; }
}
@media (max-width: 720px) {
	.nct-db-main { padding: 0 12px 20px; }
	.nct-db-head { margin: 0 -12px 14px; padding: 16px; }
	.nct-db-head-row { flex-wrap: wrap; }
	.nct-db-coach { margin-left: 0; }
	.nct-db-tiles { grid-template-columns: 1fr 1fr; }
	.nct-db-tile b { font-size: 24px; }
	.nct-db-bottom { grid-template-columns: 1fr; }
	.nct-db-card-actions { width: 100%; }
	.nct-db-card-actions .nct-db-btn { flex: 1 1 auto; }
	.nct-db-search input { width: 100%; }
	.nct-db-search { width: 100%; }
	.nct-db-progress { flex-direction: column; }
}
