/* ─────────────────────────────────────────────────────────────────────────
   iRunSA Workspace Design System
   Shared design tokens and utility classes for all workspace / management
   pages.  Aligned with the public app design language (PublicProfile is
   the canonical reference).  Import once via _Layout; pages override with
   @section Styles as needed.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Colour palette (must match PublicProfile.cshtml) ──────────────── */
  --ws-bg:        #0b0d12;          /* Page background                   */
  --ws-surface:   #13151b;          /* Card / panel surface              */
  --ws-surface2:  #1a1d26;          /* Elevated surface (hover, modal)   */
  --ws-border:    #1e2029;          /* Default border                    */
  --ws-border2:   rgba(255,255,255,.06); /* Subtle border              */
  --ws-gold:      #fca920;          /* Primary accent                    */
  --ws-gold-dim:  rgba(252,169,32,.14); /* Transparent gold              */
  --ws-gold-glow: rgba(252,169,32,.08); /* Very subtle gold bg           */
  --ws-text:      #f9fafb;          /* Primary text                      */
  --ws-text2:     #d1d5db;          /* Secondary text                    */
  --ws-muted:     #6b7280;          /* Muted / help text                 */
  --ws-muted2:    #4b5563;          /* Very muted                        */

  /* ── Shape ──────────────────────────────────────────────────────────── */
  --ws-radius:    12px;
  --ws-radius-sm: 8px;
  --ws-radius-pill: 999px;
}

/* ── Page shell ─────────────────────────────────────────────────────── */
.ws-shell {
  background: var(--ws-bg);
  min-height: 100vh;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 5rem;
}
.ws-inner { max-width: 1280px; margin: 0 auto; }

/* ── Page header ────────────────────────────────────────────────────── */
.ws-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.ws-page-title { font-size: clamp(1.4rem,3vw,1.85rem); font-weight: 800; color: var(--ws-text); margin: 0 0 .2rem; line-height: 1.15; }
.ws-page-sub   { font-size: .83rem; color: var(--ws-muted); margin: 0; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.ws-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  padding: 1.25rem 1.35rem;
}
.ws-card + .ws-card { margin-top: 1rem; }

/* ── Stat tiles ─────────────────────────────────────────────────────── */
.ws-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.ws-stat {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
  padding: 1.1rem 1.2rem;
}
.ws-stat-num   { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: .25rem; color: var(--ws-text); }
.ws-stat-label { font-size: .7rem; font-weight: 700; color: var(--ws-muted); text-transform: uppercase; letter-spacing: .08em; }
.ws-stat-meta  { font-size: .7rem; color: var(--ws-muted2); margin-top: .2rem; }
.ws-stat-gold  { color: var(--ws-gold); }

/* ── Section label / header row ─────────────────────────────────────── */
.ws-section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem;
}
.ws-section-label {
  font-size: .7rem; font-weight: 700; color: var(--ws-muted);
  text-transform: uppercase; letter-spacing: .1em; margin: 0 0 .85rem;
}

/* ── Tabs ───────────────────────────────────────────────────────────── */
.ws-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--ws-border);
  margin-bottom: 1.5rem; overflow-x: auto;
  scrollbar-width: none;
}
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab {
  flex-shrink: 0;
  padding: .65rem 1rem; font-size: .82rem; font-weight: 600;
  color: var(--ws-muted); border-bottom: 2px solid transparent;
  cursor: pointer; text-decoration: none !important;
  transition: color .16s, border-color .16s;
  margin-bottom: -1px; white-space: nowrap;
}
.ws-tab:hover { color: var(--ws-text2); }
.ws-tab.active { color: var(--ws-gold); border-bottom-color: var(--ws-gold); }
.ws-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.35em; height: 1.35em; border-radius: var(--ws-radius-pill);
  font-size: .7rem; font-weight: 700; background: var(--ws-surface2);
  color: var(--ws-muted); margin-left: .35rem; padding: 0 .3em;
}
.ws-tab.active .ws-tab-count { background: var(--ws-gold-dim); color: var(--ws-gold); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.ws-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.1rem; border-radius: var(--ws-radius-sm);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  text-decoration: none !important; border: 1px solid transparent;
  transition: background .16s, border-color .16s, color .16s;
  white-space: nowrap;
}
.ws-btn-gold {
  background: var(--ws-gold); color: #000; border-color: var(--ws-gold);
}
.ws-btn-gold:hover { background: #e09418; border-color: #e09418; color: #000; }

.ws-btn-outline {
  background: transparent; color: var(--ws-text2); border-color: var(--ws-border);
}
.ws-btn-outline:hover {
  border-color: var(--ws-gold); color: var(--ws-gold); background: var(--ws-gold-dim);
}
.ws-btn-ghost {
  background: rgba(255,255,255,.04); color: var(--ws-muted); border-color: var(--ws-border2);
}
.ws-btn-ghost:hover { color: var(--ws-text2); background: rgba(255,255,255,.07); }

.ws-btn-danger {
  background: rgba(239,68,68,.1); color: #fca5a5; border-color: rgba(239,68,68,.3);
}
.ws-btn-danger:hover { background: rgba(239,68,68,.18); }

/* ── Badges / status pills ──────────────────────────────────────────── */
.ws-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .65rem; border-radius: var(--ws-radius-pill);
  font-size: .71rem; font-weight: 700; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04);
  color: #9ca3af;
}
.ws-badge-verified { color: #86efac; border-color: rgba(34,197,94,.3);  background: rgba(34,197,94,.07);  }
.ws-badge-pending  { color: #fcd34d; border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.06); }
.ws-badge-danger   { color: #fca5a5; border-color: rgba(239,68,68,.3);  background: rgba(239,68,68,.07);  }
.ws-badge-gold     { color: var(--ws-gold); border-color: var(--ws-gold-dim); background: var(--ws-gold-glow); }
.ws-badge-info     { color: #93c5fd; border-color: rgba(59,130,246,.3); background: rgba(59,130,246,.07); }

/* ── Roster / athlete card grid ─────────────────────────────────────── */
.ws-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}
.ws-athlete-card {
  background: var(--ws-surface); border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius); padding: 1rem 1.1rem;
  display: flex; align-items: center; gap: .9rem;
  text-decoration: none !important; transition: border-color .16s, background .16s;
}
.ws-athlete-card:hover {
  border-color: rgba(252,169,32,.3); background: rgba(252,169,32,.03);
}
.ws-avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--ws-surface2); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--ws-gold); border: 1px solid var(--ws-border);
}
.ws-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ws-avatar-lg  { width: 60px; height: 60px; font-size: 1.4rem; }
.ws-athlete-name   { font-size: .88rem; font-weight: 700; color: var(--ws-text); margin: 0; }
.ws-athlete-meta   { font-size: .75rem; color: var(--ws-muted); margin: .15rem 0 0; }

/* ── Action / notification item ─────────────────────────────────────── */
.ws-action-item {
  background: var(--ws-surface); border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius); padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.ws-action-item + .ws-action-item { margin-top: .75rem; }
.ws-action-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.ws-action-title { font-size: .88rem; font-weight: 700; color: var(--ws-text); }
.ws-action-body  { font-size: .8rem; color: var(--ws-muted); line-height: 1.5; }
.ws-action-btns  { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }

/* ── Banner / alert ─────────────────────────────────────────────────── */
.ws-banner {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--ws-radius); padding: .9rem 1.1rem;
  display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.5rem;
}
.ws-banner-icon { color: #fcd34d; flex-shrink: 0; margin-top: .1rem; }
.ws-banner-text { font-size: .82rem; color: #fcd34d; line-height: 1.5; }
.ws-banner a    { color: var(--ws-gold); font-weight: 600; }

/* ── Empty state ────────────────────────────────────────────────────── */
.ws-empty {
  text-align: center; padding: 3.5rem 1.5rem;
  color: var(--ws-muted); font-size: .88rem;
}
.ws-empty i { font-size: 2.5rem; display: block; margin: 0 auto .85rem; opacity: .3; }

/* ── Table ──────────────────────────────────────────────────────────── */
.ws-table { width: 100%; border-collapse: collapse; }
.ws-table thead th {
  font-size: .7rem; font-weight: 700; color: var(--ws-muted);
  text-transform: uppercase; letter-spacing: .07em;
  padding: .65rem .9rem; border-bottom: 1px solid var(--ws-border);
  text-align: left; white-space: nowrap;
}
.ws-table tbody td {
  padding: .75rem .9rem; font-size: .83rem; color: var(--ws-text2);
  border-bottom: 1px solid var(--ws-border2);
}
.ws-table tbody tr:last-child td { border-bottom: none; }
.ws-table tbody tr:hover td { background: rgba(255,255,255,.015); }

/* ── Divider ────────────────────────────────────────────────────────── */
.ws-divider {
  border: none; border-top: 1px solid var(--ws-border); margin: 1.5rem 0;
}

/* ── Quick-action link cards ────────────────────────────────────────── */
.ws-action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.ws-action-card {
  background: var(--ws-surface); border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius); padding: 1.25rem; text-decoration: none !important;
  display: flex; flex-direction: column; gap: .6rem;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.ws-action-card:hover {
  border-color: rgba(252,169,32,.3); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.ws-action-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.ws-action-card-title { font-size: .88rem; font-weight: 700; color: var(--ws-text); margin: 0; }
.ws-action-card-desc  { font-size: .75rem; color: var(--ws-muted); margin: 0; line-height: 1.45; }

/* ── Completeness / progress bar ────────────────────────────────────── */
.ws-progress      { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.ws-progress-fill { height: 100%; border-radius: 3px; background: var(--ws-gold); transition: width .4s; }

/* ── Inline athlete list row (inside a ws-card) ─────────────────────── */
.ws-athlete-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 0; border-bottom: 1px solid var(--ws-border2);
}
.ws-athlete-row:last-child { border-bottom: none; }
.ws-athlete-row-name { font-size: .88rem; color: var(--ws-text2); font-weight: 600; }
.ws-athlete-row-meta { font-size: .75rem; color: var(--ws-muted); margin-top: .1rem; }

/* ── Banner: make text fill so the CTA button sits at the right ─────── */
.ws-banner-text { flex: 1; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ws-stats-grid   { grid-template-columns: 1fr 1fr; }
  .ws-roster       { grid-template-columns: 1fr; }
  .ws-page-header  { flex-direction: column; }
  .ws-tabs         { border-radius: 0; }
  .ws-btn          { font-size: .79rem; padding: .45rem .9rem; }
  .ws-action-cards { grid-template-columns: 1fr; }
}
