:root {
  --cell-size: 34px;
  --gap: 4px;
  --bg: #111827;
  --card: #1f2937;
  --card2: #0f172a;
  --text: #f9fafb;
  --muted: #9ca3af;
  --border: #374151;
  --blue: #007bff;
  --blue-dark: #0056b3;
  --red: #dc2626;
  --green: #22c55e;
  --purple: #7c3aed;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
}

.board-name {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.topbar nav {
  display: flex;
  gap: 10px;
}

.topbar a {
  color: white;
  text-decoration: none;
  background: #243044;
  padding: 8px 10px;
  border-radius: 9px;
}

.topbar a:hover {
  background: var(--blue);
}

.container {
  padding: 20px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

input, textarea, select {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  min-width: 130px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input[type="range"] {
  min-width: 220px;
  padding: 0;
}

button, .button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--blue);
  color: white;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover, .button:hover { background: var(--blue-dark); }

button.danger { background: var(--red); }
button.danger:hover { background: #b91c1c; }

button.preset { background: var(--purple); }
button.preset:hover { background: #6d28d9; }

button.secondary, .button.secondary { background: #334155; }
button.secondary:hover, .button.secondary:hover { background: #475569; }

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.grid-wrapper {
  overflow: auto;
  padding-bottom: 12px;
}

.grid {
  display: grid;
  gap: var(--gap);
  width: max-content;
  background: #0b1120;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 7px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #6b7280;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.cell:hover {
  transform: scale(1.08);
  border-color: var(--blue);
}

.cell.yellow {
  background: #ffd400;
  color: #111827;
  border-color: #ffd400;
  box-shadow: 0 0 12px rgba(255, 212, 0, 0.8);
}

.cell.blue {
  background: #007bff;
  color: white;
  border-color: #007bff;
  box-shadow: 0 0 12px rgba(0, 123, 255, 0.8);
}

.cell.green {
  background: #22c55e;
  color: #111827;
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
}

.cell.purple {
  background: #a855f7;
  color: white;
  border-color: #a855f7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card-list {
  display: grid;
  gap: 10px;
}

.bloc-card, .user-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.bloc-card h3, .user-card h3 {
  margin: 0 0 6px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card2);
  border-radius: 12px;
  overflow: hidden;
}

.table th, .table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
}

.table th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 950px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --cell-size: 26px;
    --gap: 3px;
  }

  .container {
    padding: 12px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
