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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050709;
  color: #f5f5f5;
}

.app-header {
  background: #23953C;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title {
  font-size: 18px;
  font-weight: 600;
}

.app-user {
  font-size: 13px;
  opacity: 0.9;
}

.app-main {
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 12px 24px;
}

.card {
  background: #15191e;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  margin-bottom: 18px;
  border: 1px solid #262d36;
}

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

.field-label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

button {
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  background: #23953C;
  color: #fff;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.status {
  font-size: 13px;
  margin-top: 6px;
  color: #555;
}

.hint {
  font-size: 12px;
  color: #666;
}

.hidden {
  display: none !important;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.app-nav button {
  background: #eee;
  color: #222;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.app-nav button.active {
  background: #23953C;
  color: #fff;
}

.app-content {
  min-height: 300px;
}

.view {
  animation: fadeIn 0.15s ease-out;
}

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

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

.form-grid .full-width {
  grid-column: 1 / -1;
}

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

.roster-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fafafa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: #222;
}


.roster-item:hover {
  background: #f0f9f3;
  border-color: #23953C33;
}

.roster-item-main {
  display: flex;
  flex-direction: column;
}

.roster-name {
  font-weight: 600;
  color: #222;
}

.roster-meta {
  font-size: 12px;
  color: #666;
}

.roster-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eee;
}

.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin: 2px 4px 2px 0;
  background: #f0f0f0;
}

.tag-bad { background: #ffebee; color: #b71c1c; }
.tag-ok  { background: #fff8e1; color: #b28900; }
.tag-good { background: #e8f5e9; color: #1b5e20; }

@media (max-width: 768px) {
  .app-main {
    margin-top: 8px;
  }
}


/* --- Pro Analytics coach theme additions --- */
.app-header {
  background: #0b0f12;
  border-bottom: 1px solid #23953C;
}

.app-title {
  font-weight: 600;
  letter-spacing: 0.03em;
}

.app-main {
  max-width: 1100px;
}

.nav-button {
  background: transparent;
  border-radius: 999px;
  border: 1px solid #2b323c;
  color: #f5f5f5;
}

.nav-button.active {
  background: #23953C;
  border-color: #23953C;
  color: #fff;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.status {
  background: #11151b;
  border: 1px solid #262d36;
  color: #d0d5dd;
}

input, select, textarea {
  background: #0b0f12;
  border: 1px solid #262d36;
  color: #f5f5f5;
}

input::placeholder,
textarea::placeholder {
  color: #7a828f;
}

.tag-pill {
  background: #11151b;
  border: 1px solid #262d36;
}

.tag-bad { background: rgba(183,28,28,0.16); color: #ff8a80; }
.tag-ok  { background: rgba(178,137,0,0.2); color: #ffe082; }
.tag-good { background: rgba(27,94,32,0.24); color: #b9f6ca; }

/* Coach dashboard tabs */
.coach-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.coach-tab-button {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #2b323c;
  background: #0b0f12;
  color: #e4e7ec;
  font-size: 12px;
  cursor: pointer;
}

.coach-tab-button.active {
  background: #23953C;
  border-color: #23953C;
  color: #fff;
}

.coach-tab-view {
  margin-top: 4px;
}

.coach-metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0 16px 0;
}

.coach-metric-card {
  background: #11151b;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #262d36;
}

.coach-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.7;
}

.coach-metric-main {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.coach-metric-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

.chart-card {
  background: #11151b;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #262d36;
  margin-top: 8px;
}

.coach-subtitle {
  font-size: 12px;
  opacity: 0.8;
  margin-top: -4px;
  margin-bottom: 10px;
}

.coach-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px 0;
  font-size: 12px;
}

.coach-selector-row select {
  min-width: 160px;
}

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

.engagement-card {
  background: #11151b;
  border-radius: 10px;
  border: 1px solid #262d36;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.engagement-name {
  font-size: 14px;
  font-weight: 500;
}

.engagement-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

.coach-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.coach-chip-hot {
  background: rgba(35,149,60,0.16);
  border-color: #23953C;
  color: #b9f6ca;
}

.coach-chip-warm {
  background: rgba(255,193,7,0.12);
  border-color: #ffca28;
  color: #ffe082;
}

.coach-chip-cold {
  background: rgba(244,67,54,0.12);
  border-color: #ef5350;
  color: #ff8a80;
}

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

.alert-card {
  background: #11151b;
  border-radius: 10px;
  border: 1px solid #262d36;
  padding: 8px 10px;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.alert-name {
  font-size: 14px;
  font-weight: 500;
}

.alert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.alert-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #15191e;
  border: 1px solid #262d36;
}

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

.coach-table th,
.coach-table td {
  border: 1px solid #ccc;
  padding: 0.35rem 0.5rem;
  text-align: center; /* center by default */
}

/* Keep the Player column left-aligned for readability */
.coach-table th:first-child,
.coach-table td:first-child {
  text-align: left;
}

.coach-table tr.row-improving td {
  background: rgba(35,149,60,0.08);
}

.coach-table tr.row-declining td {
  background: rgba(231,76,60,0.08);
}

.coach-table tr.row-flat td {
  background: rgba(120,120,120,0.06);
}

.coach-home {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 1.5rem 1.25rem 2.5rem;
}

.card-elevated {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  padding: 1.25rem 1.5rem;
}

/* HERO */

.coach-hero {
  position: relative;
  overflow: hidden;
}

.coach-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, #23953c22, transparent 55%);
  pointer-events: none;
}

.coach-hero-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.coach-hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #23953c;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(35, 149, 60, 0.45);
  flex-shrink: 0;
}

.coach-hero-text h1 {
  margin: 0;
  font-size: 1.35rem;
}

.coach-hero-sub {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: #4a4a4a;
}

.coach-hero-meta {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #555;
  position: relative;
  z-index: 1;
}

/* KPI SECTION */

.coach-kpi-section > h2,
.coach-highlight-section > h2,
.coach-actions-section > h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.coach-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.9rem;
}

.coach-kpi {
  position: relative;
  overflow: hidden;
}

.coach-kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.coach-kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.coach-kpi-hint {
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.35rem;
}

/* HIGHLIGHTS */

.coach-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
}

.coach-highlight h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.coach-highlight-main {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #23953c;
}

.coach-highlight-note {
  margin: 0;
  font-size: 0.78rem;
  color: #777;
}

/* ACTIONS */

.coach-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.coach-action {
  border: none;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  background: #ffffff;
}

.coach-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.08);
  background: #f8fff9;
}

.coach-action-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.coach-action-desc {
  font-size: 0.82rem;
  color: #666;
}

/* Small screen tidy-up */

@media (max-width: 600px) {
  .coach-home {
    padding: 1rem 0.75rem 2rem;
  }

  .coach-hero-top {
    align-items: flex-start;
  }

  .coach-hero-logo {
    width: 48px;
    height: 48px;
    font-size: 0.8rem;
  }
}

/* --- FIX TILE TEXT COLORS (white-on-white issue) ------------------------ */

/* KPI cards */
.coach-kpi-value,
.coach-kpi-label,
.coach-kpi-hint {
  color: #222 !important;
}

/* Highlight cards */
.coach-highlight h3,
.coach-highlight-main,
.coach-highlight-note {
  color: #222 !important;
}

/* Action cards */
.coach-action-title,
.coach-action-desc {
  color: #222 !important;
}

/* Hero subtitle + meta should stay readable too */
.coach-hero-sub,
.coach-hero-meta {
  color: #333 !important;
}

/* Force hero header text to be dark and readable */
.coach-hero-text h1 {
  color: #111 !important;
}

.coach-hero-sub,
.coach-hero-meta {
  color: #333 !important;
}

.coach-hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #23953c;
  box-shadow: 0 8px 20px rgba(35, 149, 60, 0.45);
  flex-shrink: 0;
  overflow: hidden;  /* important so the logo stays inside the circle */
}

.coach-hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.coach-team-selector {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* --- Par-Type Analytics layout --- */

.coach-subtabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.coach-subtab-button {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #2b323c;
  background: #0b0f12;
  color: #e4e7ec;
  font-size: 12px;
  cursor: pointer;
}

.coach-subtab-button.active {
  background: #23953C;
  border-color: #23953C;
  color: #fff;
}

.par-type-content {
  margin-top: 4px;
}

.par-type-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.par-type-chart-placeholder {
  font-size: 12px;
  color: #d0d5dd;
}

/* Tiles row */

.par-type-tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}

.par-type-tile {
  background: #11151b;
  border-radius: 10px;
  border: 1px solid #262d36;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.par-type-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
  border-color: #23953C;
}

.par-type-tile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 4px;
}

.par-type-tile-info {
  font-size: 12px;
  opacity: 0.8;
}

/* Secondary metrics card */

.par-type-metrics-card {
  margin-top: 4px;
}

.par-type-metrics-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-bottom: 4px;
}

.par-type-metrics-table th,
.par-type-metrics-table td {
  font-size: 11px;
}

.par-type-lostband {
  margin: 6px 0 14px;
  display: flex;
  gap: 18px;
}

.par-type-lostband-item {
  background: #11151b;
  border: 1px solid #262d36;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
}

.par-type-lostband-label {
  opacity: 0.75;
  margin-bottom: 2px;
}

.par-type-lostband-value {
  font-size: 14px;
  font-weight: 600;
}

.par-type-interpretation {
  margin-top: 16px;
  background: #11151b;
  border: 1px solid #262d36;
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.par-type-interp-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.par-type-interp-body p {
  margin: 0 0 8px;
  opacity: 0.9;
}

.par-type-refband {
  margin-top: -2px;
  margin-bottom: 10px;
  background: #0b0f12;
  border: 1px solid #262d36;
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  opacity: 0.85;
}

.par-type-refgrid {
  display: flex;
  gap: 18px;
  margin: 6px 0;
}

.par-type-refnote {
  opacity: 0.7;
  font-size: 10px;
}

/* ============================
   Advanced Insights – Dark Mode
   ============================ */

.adv-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 8px;
}

/* Each par-type block */
.adv-section {
  background: #181b20;             /* dark tile, like your other cards */
  border-radius: 12px;
  border: 1px solid #262b33;
  padding: 12px 16px;
}

/* Section headings (Par 3, Par 4, Par 5) */
.adv-section h3 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e5e7eb;
}

/* Header row for This Week / 8-Week / All-Time */
.adv-header-row,
.adv-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  align-items: center;
}

.adv-header-row {
  padding: 4px 0 6px;
  border-bottom: 1px solid #262b33;
}

.adv-header-spacer {
  /* keeps metric label column aligned */
}

.adv-header {
  font-size: 0.75rem;
  text-align: center;
  font-weight: 600;
  color: #9ca3af;                  /* muted gray */
}

/* Metric rows */
.adv-row {
  padding: 4px 0;
  font-size: 0.85rem;
}

.adv-label {
  font-weight: 500;
  color: #e5e7eb;
}

.adv-val {
  text-align: center;
  color: #f9fafb;
}

/* Hot / Cold / Normal backgrounds on dark */
.adv-hot {
  background-color: rgba(220, 38, 38, 0.18);   /* subtle red */
}

.adv-cold {
  background-color: rgba(37, 99, 235, 0.18);   /* subtle blue */
}

.adv-normal {
  background-color: transparent;
}

/* Coach band at bottom */
.adv-coachband {
  margin-top: 8px;
  background: #111318;
  border-radius: 12px;
  border: 1px solid #262b33;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adv-coachband-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.adv-coachband-row {
  display: grid;
  grid-template-columns: 0.8fr 3.2fr;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid #1f242b;
}

.adv-coachband-row:first-of-type {
  border-top: none;
}

.adv-coachband-par {
  font-weight: 600;
  font-size: 0.85rem;
  color: #d1d5db;
}

.adv-coachband-body {
  font-size: 0.8rem;
  color: #9ca3af;
}

.adv-coachband-empty {
  font-size: 0.8rem;
  color: #6b7280;
}

.par-type-window-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
}

.par-type-window-selector label {
  color: #d1d5db;
  font-size: 0.85rem;
}

.par-type-window-selector select {
  background: #181b20;
  border: 1px solid #262b33;
  border-radius: 6px;
  padding: 4px 8px;
  color: #f9fafb;
}
