/* ═══════════════════════════════════════════════════════════════
   Akari Analytics – Dashboard Styles
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --green-dark:   #2d5a3d;
  --green-mid:    #3a7050;
  --green-light:  #4f8a67;
  --accent-red:   #e03a3a;
  --accent-amber: #f59e0b;
  --accent-blue:  #2563eb;
  --bg-page:      #f0f0ee;
  --bg-card:      #ffffff;
  --text-primary: #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --radius:       8px;
  --font:         'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ───── TOP BAR ───── */
.topbar {
  background: var(--green-dark);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.topbar-left  { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-center{ flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo-svg  { width: 120px; height: 36px; }

.club-badge {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

/* Search */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 24px;
  padding: 6px 16px;
  width: 360px;
  transition: background .2s;
}
.search-box:focus-within { background: rgba(255,255,255,.22); }
.search-icon { flex-shrink: 0; }
.search-box input {
  background: none; border: none; outline: none;
  color: white; font-size: 13.5px; width: 100%;
  font-family: var(--font);
}
.search-box input::placeholder { color: rgba(255,255,255,.55); }

/* Buttons */
.btn-report {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: white; font-family: var(--font);
  font-size: 13px; font-weight: 500;
  padding: 6px 14px; border-radius: 6px; cursor: pointer;
  transition: background .2s;
}
.btn-report:hover { background: rgba(255,255,255,.25); }

.icon-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 6px; border-radius: 6px;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.15); }

/* User menu */
.user-menu  { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-info  { display: flex; flex-direction: column; align-items: flex-end; }
.user-name  { font-size: 13px; font-weight: 600; color: white; }
.user-role  { font-size: 11px; color: rgba(255,255,255,.6); }
.user-avatar{
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}

/* ───── SUB NAV ───── */
.subnav {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  position: sticky;
  top: 60px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.subnav-list {
  display: flex; align-items: center;
  list-style: none; gap: 4px;
  height: 48px;
}

.subnav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px; cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  user-select: none;
}
.subnav-item:hover { background: #f3f4f6; color: var(--text-primary); }
.subnav-item.active{
  background: #e8f5ed;
  color: var(--green-dark);
  font-weight: 600;
}
.chevron { margin-left: 2px; color: currentColor; }

/* ───── MAIN CONTENT ───── */
.main-content {
  flex: 1;
  padding: 24px 24px 32px;
  display: flex; flex-direction: column; gap: 22px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  align-self: center;
}

/* Grid helpers */
.grid-row      { display: grid; gap: 22px; }
.grid-2-col    { grid-template-columns: 1fr 1fr; }

/* ───── CARDS ───── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ───── WELCOME CARD ───── */
.welcome-card { text-align: center; }
.welcome-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

.avatar-large {
  width: 80px; height: 80px; border-radius: 50%;
  background: #f3f4f6; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--text-muted);
  margin: 0 auto 14px;
}
.user-details { margin-bottom: 8px; }
.user-fullname { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.user-email    { font-size: 12.5px; color: var(--text-muted); }
.user-badge    {
  display: inline-block; margin-top: 6px;
  font-size: 12px; font-weight: 600;
  background: #e8f5ed; color: var(--green-dark);
  padding: 2px 10px; border-radius: 12px;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.quick-links-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.quick-links-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-link-btn {
  background: var(--accent-blue); color: white;
  border: none; border-radius: 6px;
  padding: 8px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: opacity .15s;
}
.quick-link-btn:hover { opacity: .85; }

/* ───── DATA TABLES ───── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; padding: 8px 12px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.fw-600 { font-weight: 600; }

.player-thumb {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-dark), var(--green-light));
  color: white; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.player-thumb.sm { width: 36px; height: 36px; font-size: 11px; }
.star-red { color: var(--accent-red); font-size: 16px; }

/* ───── BUTTONS ───── */
.btn-primary {
  background: var(--accent-blue); color: white;
  border: none; border-radius: 6px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; }

.btn-open-report {
  background: var(--accent-amber); color: white;
  border: none; border-radius: 5px;
  padding: 5px 10px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}
.btn-pdf {
  background: var(--accent-red); color: white;
  border: none; border-radius: 5px;
  padding: 5px 10px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}

/* ───── POTENTIAL LIST ───── */
.control-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 16px; }
.control-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.select-control {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px; font-size: 13px; font-family: var(--font);
  background: white; cursor: pointer;
}

.potential-list  { display: flex; flex-direction: column; gap: 8px; }
.potential-item  {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 6px;
  transition: background .15s;
}
.potential-item:hover { background: #f9fafb; }

.potential-rank  {
  width: 24px; height: 24px; border-radius: 50%;
  background: #f3f4f6; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex-shrink: 0;
}
.potential-rank.top { background: #fef3c7; color: #92400e; }

.potential-info  { flex: 1; display: flex; flex-direction: column; }
.potential-name  { font-size: 13.5px; font-weight: 600; }
.potential-pos   { font-size: 11.5px; color: var(--text-muted); }

.potential-score {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.potential-score.high   { background: #d1fae5; color: #065f46; }
.potential-score.medium { background: #fef3c7; color: #92400e; }
.potential-score.low    { background: #fee2e2; color: #991b1b; }

/* ───── RADAR ───── */
.radar-legend { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.legend-dot   { width: 12px; height: 12px; border-radius: 50%; }
.legend-dot.blue  { background: #3b82f6; }
.legend-dot.green { background: #22c55e; }
.legend-label { margin-right: 12px; color: var(--text-muted); font-weight: 500; }

.radar-container { display: flex; justify-content: center; }
.radar-svg { width: 100%; max-width: 360px; }

/* ───── VERDICT BADGES ───── */
.club-tag { color: var(--text-muted); font-size: 12px; }
.verdict-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
}
.verdict-badge.hp { background: #d1fae5; color: #065f46; }
.verdict-badge.ps { background: #e0f2fe; color: #075985; }
.verdict-badge.di { background: #fee2e2; color: #991b1b; }

.table-footer { font-size: 12px; color: var(--text-muted); margin-top: 10px; }

/* ───── FOOTER ───── */
.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: white;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 900px) {
  .grid-2-col { grid-template-columns: 1fr; }
  .search-box { width: 220px; }
  .user-info  { display: none; }
}
