/* ═══════════════════════════════════════════════════════════════
   components.css — Haspel Intelligence Demo
   Karten, Tabellen, Modal, Badges, Buttons, Navigation, Tags
   Extrahiert: 2026-02-22 | Agent: Frontend-Modularisierung
   ═══════════════════════════════════════════════════════════════ */

/* NAV ITEM */
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.52); cursor: pointer; transition: all .15s; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(26,83,232,0.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 20px; font-family: 'DM Mono', monospace; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; font-family: 'Plus Jakarta Sans', sans-serif; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(26,83,232,0.28); }
.btn-primary:hover { background: #1140CC; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,83,232,0.38); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

/* KPI CARDS */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-r); padding: 20px; }
.kpi-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.kpi-value { font-size: 28px; font-weight: 500; margin: 6px 0 4px; font-family: 'DM Mono', monospace; letter-spacing: -1px; }
.kpi-delta { font-size: 12px; }
.kpi-delta.up { color: #0D8F6A; }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--muted); }

/* CARD */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-r); padding: 20px; }
.card-title { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }

/* PLAYER TABLE */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-r); overflow: hidden; }
.table-toolbar { padding: 14px 20px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface); }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; flex: 1; min-width: 200px; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; font-family: 'Plus Jakarta Sans', sans-serif; }
.search-box svg { color: var(--muted); flex-shrink: 0; }
.filter-btn { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: rgba(26,83,232,0.09); border-color: rgba(26,83,232,0.25); color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 16px; text-align: left; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.9px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface2); }
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 12px 16px; font-size: 13px; white-space: nowrap; }

.player-name { font-weight: 600; }
.player-club { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* LIGA BADGE */
.liga-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.liga-bl  { background: rgba(26,83,232,0.10); color: var(--accent); }
.liga-bl2 { background: rgba(14,127,192,0.10); color: var(--accent2); }
.liga-3   { background: rgba(201,123,0,0.10); color: var(--warn); }
.liga-rl  { background: rgba(90,107,136,0.10); color: var(--muted); }

/* SCORE BAR */
.score-cell { display: flex; align-items: center; gap: 8px; }
.score-num { font-size: 12px; font-weight: 500; width: 28px; font-family: 'DM Mono', monospace; }
.score-bar-wrap { flex: 1; height: 4px; background: var(--surface2); border-radius: 4px; min-width: 50px; }
.score-bar { height: 4px; border-radius: 4px; }
.score-high .score-num { color: var(--accent); }
.score-high .score-bar { background: linear-gradient(90deg, #0A2FA0, var(--accent)); }
.score-mid .score-num { color: var(--warn); }
.score-mid .score-bar { background: linear-gradient(90deg, var(--warn), #E8A020); }
.score-low .score-num { color: var(--danger); }
.score-low .score-bar { background: linear-gradient(90deg, var(--danger), #E85050); }

/* MARKET VALUE */
.mv { font-weight: 500; font-family: 'DM Mono', monospace; }
.mv-m { color: var(--accent); }
.mv-500k { color: var(--accent2); }
.mv-other { color: var(--text); }

/* CONTRACT INDICATOR */
.contract { font-size: 12px; font-weight: 500; font-family: 'DM Mono', monospace; }
.contract.ok { color: #0D8F6A; }
.contract.warn { color: var(--warn); }
.contract.danger { color: var(--danger); }
.contract.unknown { color: var(--muted); }

/* DETAIL MODAL */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.6); z-index: 200;
  backdrop-filter: blur(6px); align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 760px; margin: auto; overflow: hidden;
  box-shadow: 0 20px 60px rgba(37,99,235,0.15);
}
.modal-header { padding: 24px 28px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-close { background: var(--surface2); border: 1px solid var(--border); color: var(--text); width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; flex-shrink: 0; }
.modal-close:hover { background: rgba(26,83,232,0.09); color: var(--accent); }
.modal-body { padding: 24px 28px 28px; }
.modal-player-top { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.modal-avatar { width: 64px; height: 64px; border-radius: 12px; background: rgba(26,83,232,0.10); border: 1.5px solid rgba(26,83,232,0.22); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--accent); flex-shrink: 0; font-family: 'Plus Jakarta Sans', sans-serif; }
.modal-player-name { font-size: 22px; font-weight: 700; }
.modal-player-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.modal-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* TAGS */
.tag { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tag-pos { background: rgba(26,83,232,0.12); color: var(--accent); }
.tag-league { background: var(--surface2); color: var(--muted); }
.tag-berater { background: #ede9fe; color: #6d28d9; }

/* SCORE RADAR (Modal) */
.scores-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.score-item { background: var(--surface2); border-radius: 10px; padding: 14px; border: 1px solid var(--border); }
.score-item-label { font-size: 11px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.8px; }
.score-item-val { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.score-item-bar { height: 5px; background: rgba(37,99,235,0.08); border-radius: 5px; }
.score-item-fill { height: 5px; border-radius: 5px; }
.master-score-box { background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid rgba(26,83,232,0.18); border-radius: 12px; padding: 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.master-score-num { font-size: 52px; font-weight: 500; color: var(--accent); line-height: 1; font-family: 'DM Mono', monospace; letter-spacing: -2px; }
.master-score-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.master-score-desc { font-size: 13px; color: var(--text); }

/* DATA ROW */
.data-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-row:last-child { border-bottom: none; }
.data-label { color: var(--muted); }
.data-val { font-weight: 500; text-align: right; }

/* SIGNALS */
.signal { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; display: flex; gap: 12px; align-items: flex-start; }
.signal-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.signal-buy { background: rgba(26,83,232,0.12); }
.signal-watch { background: #fef3c7; }
.signal-risk { background: #fee2e2; }
.signal-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.signal-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }

/* LEAGUE BREAKDOWN */
.league-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.league-name { width: 150px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-bar-wrap { flex: 1; height: 6px; background: var(--surface2); border-radius: 6px; }
.league-bar-fill { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.league-count { font-size: 12px; font-weight: 700; color: var(--accent); width: 20px; text-align: right; }

/* AGE DISTRIBUTION */
.age-chart { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.age-bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.age-bar { width: 100%; background: linear-gradient(180deg, #60a5fa, #2563eb); border-radius: 3px 3px 0 0; opacity: 0.8; transition: opacity .15s; }
.age-bar:hover { opacity: 1; }
.age-label { font-size: 9px; color: var(--muted); }

/* NEXT ACTIONS */
.action-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.action-item:last-child { border-bottom: none; }
.action-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.action-dot.hot { background: var(--danger); box-shadow: 0 0 6px rgba(220,38,38,0.5); }
.action-dot.warm { background: var(--warn); }
.action-dot.cool { background: var(--accent); }
.action-text { font-size: 13px; line-height: 1.5; flex: 1; }
.action-player { font-weight: 600; }
.action-desc { color: var(--muted); font-size: 12px; margin-top: 1px; }

/* SPARKLINE */
.sparkline { height: 48px; width: 100%; }

/* MV CHART */
.mv-chart-wrap { background: linear-gradient(135deg, var(--surface2), rgba(26,83,232,0.06)); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.mv-chart-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.mv-chart-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.mv-chart-current { text-align: right; }
.mv-chart-val { font-size: 18px; font-weight: 700; color: var(--text); }
.mv-chart-delta { font-size: 11px; margin-top: 2px; }
.mv-chart-svg { width: 100%; height: 72px; display: block; }
.mv-chart-labels { display: flex; justify-content: space-between; margin-top: 6px; }
.mv-chart-labels span { font-size: 9px; color: var(--muted); }

/* RANK BADGE */
.rank-badge {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; font-size: 11px; font-weight: 500;
  flex-shrink: 0; font-family: 'DM Mono', monospace;
}
.rank-1   { background: rgba(201,123,0,0.12); color: #92400e; border: 1px solid rgba(201,123,0,0.22); }
.rank-2   { background: rgba(90,107,136,0.10); color: #475569; border: 1px solid rgba(90,107,136,0.2); }
.rank-3   { background: rgba(180,83,9,0.10); color: #b45309; border: 1px solid rgba(180,83,9,0.2); }
.rank-top { background: rgba(26,83,232,0.09); color: var(--accent); border: 1px solid rgba(26,83,232,0.18); }
.rank-mid { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* TREND BADGE */
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.trend-up   { background: #dcfce7; color: #15803d; }
.trend-stay { background: #fef3c7; color: #b45309; }
.trend-down { background: #fee2e2; color: #b91c1c; }

/* PORTFOLIO FIT */
.pf-box { border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; border: 1px solid; }
.pf-box-positive { background: linear-gradient(135deg, #eff6ff, #dbeafe); border-color: #93c5fd; }
.pf-box-neutral { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
.pf-box-negative { background: linear-gradient(135deg, #fff1f2, #fee2e2); border-color: #fca5a5; }
.pf-header { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.pf-score-num { font-size: 36px; font-weight: 800; line-height: 1; }
.pf-multiplier { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pf-multiplier-pos { background: #dbeafe; color: #1d4ed8; }
.pf-multiplier-neu { background: #fef3c7; color: #b45309; }
.pf-multiplier-neg { background: #fee2e2; color: #b91c1c; }
.pf-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px; }
.pf-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-item { background: rgba(255,255,255,0.7); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.pf-item-label { font-size: 10px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.6px; }
.pf-item-val { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.pf-item-bar { height: 3px; background: rgba(37,99,235,0.1); border-radius: 3px; }
.pf-item-fill { height: 3px; border-radius: 3px; }
.pf-reason { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* FINAL SCORE BOX */
.final-score-row { display: flex; align-items: center; gap: 10px; padding: 14px 0 0; border-top: 1px solid var(--border); margin-top: 4px; }
.final-score-eq { font-size: 12px; color: var(--muted); }
.final-score-num { font-size: 32px; font-weight: 500; color: var(--accent); font-family: 'DM Mono', monospace; letter-spacing: -1px; }
.final-score-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }

/* WEIGHT TUNING */
.preset-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.preset-btn {
  padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: rgba(26,83,232,0.09); border-color: rgba(26,83,232,0.25); color: var(--accent); }
.weight-row {
  display: grid; grid-template-columns: 130px 1fr 52px 52px; align-items: center;
  gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.weight-row:last-child { border-bottom: none; }
.weight-label { font-size: 13px; font-weight: 500; }
.weight-label-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--surface2); border-radius: 5px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(26,83,232,0.2), 0 2px 6px rgba(26,83,232,0.25);
}
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 5px; }
.weight-pct { font-size: 14px; font-weight: 500; color: var(--accent); text-align: right; white-space: nowrap; font-family: 'DM Mono', monospace; }
.weight-raw { font-size: 11px; color: var(--muted); text-align: right; }
.sum-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 0; }
.sum-indicator { font-size: 13px; color: var(--muted); }
.sum-val { font-size: 18px; font-weight: 700; }

/* LIVE RANK TABLE */
.live-rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.live-rank-row:last-child { border-bottom: none; }
.rank-num { font-size: 11px; color: var(--muted); width: 20px; text-align: right; flex-shrink: 0; }
.rank-name { flex: 1; font-size: 13px; font-weight: 500; }
.rank-club { font-size: 11px; color: var(--muted); }
.rank-score-new { font-size: 16px; font-weight: 700; color: var(--accent); width: 36px; text-align: right; }
.rank-delta { font-size: 11px; width: 32px; text-align: right; }
.rank-delta.up { color: #16a34a; }
.rank-delta.dn { color: var(--danger); }
.rank-delta.eq { color: var(--muted); }

/* ACCORDION SECTIONS (Modal) */
.acc-section { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: var(--surface); overflow: hidden; }
.acc-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; transition: background 0.15s; }
.acc-header:hover { background: var(--surface2); }
.acc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text); }
.acc-preview { font-size: 12px; color: var(--muted); margin-left: auto; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.acc-chevron { font-size: 10px; color: var(--muted); transition: transform 0.3s ease; flex-shrink: 0; }
.acc-section.open .acc-chevron { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.acc-section.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; }
.acc-content { padding: 0 16px 16px; }

/* QUICK KPI STRIP */
.kpi-strip { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.kpi-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; text-align: center; flex: 1; min-width: 72px; }
.kpi-chip-val { font-size: 14px; font-weight: 700; line-height: 1.2; font-family: 'DM Mono', monospace; white-space: nowrap; }
.kpi-chip-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

/* COMPACT SCORE STRIP */
.score-strip { display: flex; gap: 6px; }
.score-chip { flex: 1; background: var(--surface2); border-radius: 8px; padding: 8px 4px; text-align: center; }
.score-chip-val { font-size: 20px; font-weight: 800; line-height: 1; }
.score-chip-bar { height: 4px; background: rgba(0,0,0,0.06); border-radius: 2px; margin: 6px 2px 4px; overflow: hidden; }
.score-chip-label { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* MODAL RUMORS SECTION */
.modal-rumors { margin-top: 20px; }
.rumor-mini-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; font-size: 12px; }
.rumor-mini-headline { font-weight: 600; margin-bottom: 4px; }
.rumor-mini-meta { color: var(--muted); font-size: 11px; }

/* CAREER TIMELINE */
.career-tl { display: flex; position: relative; overflow-x: auto; padding-bottom: 8px; margin-top: 12px; }
.career-tl::before { content: ''; position: absolute; top: 13px; left: 14px; right: 14px; height: 2px; background: var(--border); }
.career-step { display: flex; flex-direction: column; align-items: center; min-width: 90px; flex: 1; position: relative; z-index: 1; }
.career-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; flex-shrink: 0; }
.career-dot.past    { background: var(--muted); box-shadow: 0 0 0 2px var(--muted); }
.career-dot.youth   { background: #e2e8f0; box-shadow: 0 0 0 2px #cbd5e1; }
.career-dot.current { background: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.3); width: 18px; height: 18px; }
.career-club { font-size: 10px; font-weight: 600; text-align: center; margin-top: 8px; padding: 0 4px; line-height: 1.3; }
.career-year { font-size: 9px; color: var(--muted); margin-top: 2px; }
.career-mv   { font-size: 9px; color: var(--accent); font-weight: 700; margin-top: 1px; }
