:root {
  --bg: #0e0f1a;
  --bg-soft: #161827;
  --bg-elev: #1d2034;
  --border: #2a2e47;
  --text: #e7e9f5;
  --muted: #8a8fb0;
  --primary: #7c5cff;
  --primary-hover: #9277ff;
  --danger: #ff5c7a;
  --success: #36d399;
  --warning: #fbbd23;

  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: 0.3px; }

.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #4dabf7);
  font-size: 18px; color: white;
  box-shadow: 0 2px 12px rgba(124, 92, 255, 0.4);
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.teams-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Podium top 3 ===== */
.podium-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--team-color);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.podium-chip.rank-1 {
  background: linear-gradient(90deg, color-mix(in srgb, var(--team-color) 18%, var(--bg-elev)), var(--bg-elev));
}

.podium-rank { font-size: 16px; line-height: 1; }
.podium-name { font-weight: 600; }
.podium-stats { display: inline-flex; gap: 8px; align-items: center; }
.podium-cells {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.podium-euros {
  color: var(--warning);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.team-summary-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
}

.team-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  background: var(--team-color, var(--primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--team-color, var(--primary)) 25%, transparent);
}

.team-score {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}

/* ===== Layout ===== */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: calc(100vh - 64px);
  transition: padding-right var(--transition);
}

body.drawer-open .layout { padding-right: 340px; }

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
}

.games-nav { display: flex; flex-direction: column; gap: 4px; }

.game-tab {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  width: 100%;
}

.game-tab:hover { background: var(--bg-elev); }

.game-tab.active {
  background: rgba(124, 92, 255, 0.12);
  border-color: rgba(124, 92, 255, 0.4);
  color: white;
}

.game-tab .game-name { display: flex; align-items: center; gap: 10px; }

.game-tab .game-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev);
  font-size: 14px;
}

.game-tab .game-progress {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.game-tab.active .game-progress { background: var(--primary); color: white; }

/* ===== Content ===== */
.content { padding: 28px 36px; overflow-y: auto; }

.game-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 28px; flex-wrap: wrap; gap: 20px;
}

.game-header h2 { margin: 0 0 6px; font-size: 28px; font-weight: 700; }

.muted { color: var(--muted); font-size: 13px; margin: 0; }

.stats { display: flex; gap: 12px; }

.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex; flex-direction: column;
  min-width: 130px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ===== Grid ===== */
.grid-wrapper { display: flex; justify-content: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: min(620px, 100%);
  aspect-ratio: 1 / 1;
}

.cell {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  user-select: none;
}

.cell-footer { margin-top: auto; }

.cell:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cell-color, transparent);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.cell.done::before { opacity: 0.22; }
.cell.done { border-color: var(--cell-color, var(--primary)); }

.cell-objective {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  z-index: 1;
  position: relative;
  color: var(--text);
}

.cell.done .cell-objective { color: white; }

.cell-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

.cell.done .cell-footer { color: rgba(255, 255, 255, 0.92); }

.cell-pseudo { font-weight: 600; font-size: 13px; }
.cell-team { font-size: 11px; opacity: 0.85; }

.cell-check {
  position: absolute;
  top: 10px; right: 12px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cell-color, var(--primary));
  display: none;
  align-items: center; justify-content: center;
  color: white; font-size: 13px;
  z-index: 2;
}

.cell.done .cell-check { display: inline-flex; }

.cell-value {
  align-self: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--warning);
  background: rgba(251, 189, 35, 0.18);
  padding: 3px 12px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  z-index: 1;
}

.cell.done .cell-value {
  background: rgba(255, 255, 255, 0.22);
  color: white;
}

.drawer-objective-value {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: rgba(251, 189, 35, 0.18);
  color: var(--warning);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

/* ===== Buttons ===== */
.btn-ghost, .btn-primary, .btn-danger, .btn-secondary {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover { background: var(--bg-soft); border-color: var(--primary); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 92, 122, 0.4);
}
.btn-danger:hover { background: rgba(255, 92, 122, 0.1); }

.btn-secondary {
  background: var(--bg-soft);
}
.btn-secondary:hover { border-color: var(--primary); }

/* ===== User chip & login ===== */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.user-chip img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
}

.user-chip-logout {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 13px;
  transition: color var(--transition);
}

.user-chip-logout:hover { color: var(--danger); }

/* ===== Drawer body (multi-mode) ===== */
.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.drawer-body .drawer-section { display: flex; flex-direction: column; gap: 10px; }

.drawer-body .drawer-section-separated {
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.drawer-body .drawer-section .input { font-size: 14px; }
.drawer-body .drawer-section .input-color { width: 100%; height: 38px; }
.drawer-body .drawer-section button { width: 100%; justify-content: center; }
.drawer-body .drawer-actions { margin-top: auto; }
.drawer-body .drawer-actions button { width: 100%; justify-content: center; padding: 10px; }

/* ===== Cell current (info de la case validée) ===== */
.cell-current {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: color-mix(in srgb, var(--team-color) 14%, var(--bg-elev));
  border: 1px solid var(--team-color);
  border-radius: 10px;
}

.cell-current .team-dot {
  width: 14px; height: 14px;
  margin-top: 2px;
}

.cell-current-pseudo { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.cell-current-team   { font-size: 12px; color: var(--muted); }
.cell-current-meta   { font-size: 11px; color: var(--muted); margin-top: 4px; opacity: 0.8; }

/* ===== Team drawer : membres ===== */
.member-list-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-row-view {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.member-row-view .member-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.member-row-view .badge {
  margin-left: auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  background: var(--team-color);
  color: white;
  border-radius: 999px;
  font-weight: 600;
}

.member-row-view .icon-btn {
  margin-left: auto;
  width: 24px; height: 24px;
}

/* ===== Invites ===== */
.invites-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invite-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.invite-code {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--primary);
}

.copy-btn { padding: 6px 10px !important; font-size: 12px; width: auto !important; }

/* ===== Status badge ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.pending { background: rgba(251, 189, 35, 0.15); color: var(--warning); }
.status-badge.active  { background: rgba(54, 211, 153, 0.15); color: var(--success); }

/* ===== Admin team cards ===== */
.admin-subsection { margin-bottom: 32px; }

.subsection-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}

.tab-count {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.admin-members-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.admin-member-row img {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-member-row .badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  color: white;
  border-radius: 999px;
  font-weight: 600;
}

.admin-member-row .discord-id {
  margin-left: auto;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  color: var(--muted);
}

/* ===== Admin management ===== */
.add-admin-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-admin-row .input { flex: 1; }

.admin-row-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}

.admin-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

.admin-info { flex: 1; min-width: 0; }
.admin-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.admin-id {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  color: var(--muted);
}

.status-badge.env-source { background: rgba(124, 92, 255, 0.15); color: var(--primary); }
.status-badge.db-source  { background: rgba(54, 211, 153, 0.15); color: var(--success); }

code {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 12px;
}

/* ===== Color palette ===== */
.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 4px 0;
}

.color-swatch {
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0;
  transition: transform var(--transition), border-color var(--transition);
  position: relative;
}

.color-swatch:hover:not(:disabled) {
  transform: scale(1.12);
  border-color: var(--text);
}

.color-swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg);
  transform: scale(1.05);
}

.color-swatch.taken {
  opacity: 0.25;
  cursor: not-allowed;
  position: relative;
}

.color-swatch.taken::after {
  content: "×";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: 700;
}

/* ===== Drawer ===== */
.drawer {
  position: fixed;
  top: 64px; right: 0;
  width: 340px;
  height: calc(100vh - 64px);
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  padding: 22px;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideIn 220ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.drawer[hidden] { display: none; }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.drawer-eyebrow {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.drawer-header h3 { margin: 0; font-size: 18px; font-weight: 600; }

.drawer-close {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}

.drawer-close:hover { background: var(--danger); border-color: var(--danger); color: white; }

.drawer-objective {
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
  padding: 14px;
  background: var(--bg-elev);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

.drawer-section { display: flex; flex-direction: column; gap: 10px; }

.drawer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 600;
}

.team-groups { display: flex; flex-direction: column; gap: 14px; }

.team-group { display: flex; flex-direction: column; gap: 6px; }

.team-group-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.member-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.member-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
}

.member-btn:hover {
  border-color: var(--team-color);
  transform: translateY(-1px);
}

.member-btn.selected {
  background: color-mix(in srgb, var(--team-color) 18%, var(--bg-elev));
  border-color: var(--team-color);
}

.member-btn .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--team-color);
  flex-shrink: 0;
}

.drawer-actions {
  margin-top: auto;
  display: flex;
  justify-content: stretch;
}

.drawer-actions .btn-danger {
  width: 100%;
  padding: 10px;
  justify-content: center;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===== Sync indicator ===== */
.sync-indicator {
  position: fixed;
  bottom: 16px; right: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  z-index: 200;
}

.sync-indicator.visible { opacity: 1; }
.sync-indicator.error {
  color: var(--danger);
  border-color: rgba(255, 92, 122, 0.4);
}

/* ===== PiP-only elements (cachés en vue principale) ===== */
.pip-only { display: none !important; }
.pip-body .pip-only { display: flex !important; }

/* ===== PiP game switcher ===== */
.pip-game-switcher {
  position: relative;
  margin-top: 6px;
}

.pip-game-switcher .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
}

.pip-chevron {
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}

.pip-game-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  min-width: 240px;
  box-shadow: var(--shadow);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
}

.pip-game-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition);
}

.pip-game-item:hover { background: var(--bg-elev); }

.pip-game-item.active {
  background: rgba(124, 92, 255, 0.15);
  color: white;
}

.pip-game-item .game-icon {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border-radius: 5px;
  font-size: 12px;
  flex-shrink: 0;
}

.pip-game-item .pip-game-name { flex: 1; }

.pip-game-item .pip-game-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: var(--bg-elev);
  padding: 2px 7px;
  border-radius: 999px;
}

.pip-game-item.active .pip-game-count {
  background: var(--primary);
  color: white;
}

/* ===== Picture-in-Picture body ===== */
.pip-body {
  margin: 0;
  padding: 18px 22px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.pip-body .game-header {
  margin-bottom: 0;
  align-items: center;
  gap: 12px;
}

.pip-body .game-header h2 {
  font-size: 18px;
  margin: 0;
}

.pip-body .game-header p { display: none; }

.pip-body .stats { gap: 8px; }

.pip-body .stat {
  padding: 6px 12px;
  min-width: 0;
}

.pip-body .stat-label {
  font-size: 9px;
  margin-bottom: 2px;
}

.pip-body .stat-value { font-size: 13px; }

.pip-body .grid-wrapper {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.pip-body .grid {
  width: 100%;
  height: 100%;
  gap: 8px;
  aspect-ratio: auto;
}

.pip-body .cell {
  padding: 10px;
}

.pip-body .cell-objective {
  font-size: 12px;
  line-height: 1.25;
}

.pip-body .cell-footer {
  font-size: 10px;
  margin-top: 6px;
}

.pip-body .cell-pseudo { font-size: 11px; }
.pip-body .cell-team   { font-size: 9px; }

.pip-body .cell-check {
  width: 16px; height: 16px;
  top: 6px; right: 8px;
  font-size: 10px;
}

.pip-body .cell-value {
  font-size: 12px;
  padding: 2px 8px;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state h3 { color: var(--text); margin: 0 0 8px; }

/* ===== Scrollbars ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== Admin-only styles ===== */
.admin-tabs {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.admin-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 12px 18px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  font-family: inherit;
}

.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.admin-content { padding: 28px 36px 0; overflow-y: auto; height: calc(100vh - 64px); }
.tab-panel { padding-bottom: 16px; }

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

.section-header h2 { margin: 0; font-size: 22px; }

.cards-list {
  display: flex; flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.card-header {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.field-inline {
  display: flex; flex-direction: column; gap: 4px;
}

.field-inline label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 600;
}

.input, .input-textarea {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}

.input:focus, .input-textarea:focus { border-color: var(--primary); }

.input-color {
  width: 44px; height: 36px;
  padding: 4px;
  cursor: pointer;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.input-narrow { width: 80px; }

.members-block { margin-top: 8px; }

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.member-row {
  display: flex; gap: 6px;
  align-items: center;
}

.member-row .input { flex: 1; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition);
}

.icon-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.objective-row {
  display: flex; gap: 6px;
  align-items: center;
}

.objective-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  width: 18px;
}

.objective-row .objective-label { flex: 1; min-width: 0; }
.objective-row .objective-value {
  width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.objective-row .objective-euro {
  font-size: 12px;
  color: var(--warning);
  font-weight: 700;
}

.card-actions {
  display: flex; justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 14px 36px;
  margin: 16px -36px 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
  z-index: 10;
}

.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 1000;
  animation: toastIn 200ms ease;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  width: min(360px, 90%);
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .input { padding: 12px 14px; font-size: 15px; }
.login-form .btn-primary { padding: 12px; justify-content: center; font-weight: 600; }
