/* =========================================================
   BASE STYLES
   ========================================================= */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 10px rgba(0,0,0,.08);
  --radius: 12px;
  --gap: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}

#app {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --- GRID LAYOUT --- */
#dashboardGrid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding-bottom: 40px;
}

/* --- GENERISCHE WEBPARTS (CARDS) --- */
/* Alle Snippets sollten diese Klasse als Basis nutzen */
.leagueCard, .chartCard, .webpart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px;
  flex: 0 1 450px;   
  display: flex;
  flex-direction: column;
}

/* Header-Bereich für Drag & Drop */
.panelHeader, .leagueHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
   padding: 8px 10px;
    min-height: unset;
}

.panelTitle, .leagueTitle { font-weight: 700; font-size: 0.95rem; }
.panelMeta, .leagueMeta { color: var(--muted); font-size: 0.75rem; }

/* --- CHART LOGIK (GENERISCH) --- */
/* Nutze im HTML: <article class="leagueCard chart-webpart"> */
.chart-webpart .panelContent { 
  position: relative;
  width: 100%;
}

.chart-webpart canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --- PLAYER FOCUS & KPI --- */
#focusImageSlot { 
  display: flex; justify-content: center; align-items: center;
  width: 100%; height: 200px; 
  background: var(--surface-2); border-radius: 10px; margin-bottom: 15px;
}

#focusImageSlot img { max-height: 100%; object-fit: contain; }

#kpiGrid { 
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; 
}

.kpi { 
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; 
}

.kpiValue { font-family: var(--mono); font-size: 18px; font-weight: 800; }
.kpiLabel { color: var(--muted); font-size: 11px; text-transform: uppercase; }

/* --- TABELLEN --- */
.leagueTable {
  width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px;
}

.leagueTable th { text-align: left; border-bottom: 1px solid var(--border); padding: 4px; color: var(--muted); }
.leagueTable td { padding: 6px 4px; border-bottom: 1px solid var(--surface-2); }

/* --- UI HELPER --- */
.delete-btn { cursor: pointer; color: var(--muted); margin-left: 10px; font-size: 18px; }
.delete-btn:hover { color: #ef4444; }

.sortable-ghost { opacity: 0.3; background: #cbd5e1 !important; border: 2px dashed #3b82f6 !important; }
.canvasContainer {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
/* --- DASHBOARD HEADER --- */
#hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#hdrTitle {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

#hdrSub {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

#hdrRight {
  text-align: right;
}

#hdrDate {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
