* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #f4f1ea;
  color: #2a2a2a;
}
.tpg-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}
h1 { font-size: 1.6rem; text-align: center; color: #c05a1e; }
.tpg-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tpg-event-image {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 16px;
  max-height: 320px;
  object-fit: cover;
}
.tpg-choice-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  flex: 1 1 45%;
  min-height: 56px;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn-yes { background: #2e7d32; color: #fff; }
.btn-no { background: #b71c1c; color: #fff; }
.btn-submit { background: #c05a1e; color: #fff; width: 100%; margin-top: 12px; min-height: 52px; }
.tpg-form { margin-top: 20px; }
.tpg-form label { display: block; margin-top: 12px; font-weight: 600; }
.tpg-form input[type="text"],
.tpg-form input[type="password"] {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin-top: 6px;
}
.tpg-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: normal;
  padding: 10px 0;
  font-size: 1.05rem;
}
.tpg-checkbox input { width: 22px; height: 22px; }
.tpg-success { border-left: 6px solid #2e7d32; }
.tpg-warning { border-left: 6px solid #f57c00; }
.tpg-error { border-left: 6px solid #b71c1c; }
.tpg-empty { text-align: center; color: #777; }
.tpg-events-list { display: flex; flex-direction: column; gap: 14px; }
.tpg-event-link { text-decoration: none; color: inherit; display: block; }
.tpg-event-link img { width: 100%; border-radius: 10px; max-height: 180px; object-fit: cover; }

table.tpg-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.tpg-table th, table.tpg-table td { padding: 8px; border-bottom: 1px solid #e0e0e0; text-align: left; }
@media (max-width: 480px) {
  table.tpg-table { display: block; overflow-x: auto; white-space: nowrap; }
}
.tpg-footer {
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  padding: 24px 16px 12px;
}

/* --- Console admin : navigation, écran de bienvenue, cartes d'évènement --- */
.tpg-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.tpg-admin-header h1 { margin: 0; text-align: left; font-size: 1.4rem; }

.tpg-navbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tpg-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e2ded2;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: #2a2a2a;
  text-decoration: none;
  white-space: nowrap;
}
.tpg-nav-link:hover { border-color: #c05a1e; color: #c05a1e; }

.tpg-welcome-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.tpg-step-card {
  background: #f4f1ea;
  border-radius: 12px;
  padding: 16px;
}
.tpg-step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #c05a1e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.tpg-step-card p { margin: 0; }
.tpg-step-card .tpg-step-title { font-weight: 600; margin-bottom: 4px; }
.tpg-step-card .tpg-step-text { color: #888; font-size: 0.85rem; }

.tpg-event-card-v2 {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tpg-event-card-v2 .tpg-event-banner {
  height: 110px;
  background: #f0e2d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.tpg-event-card-v2 .tpg-event-banner img { width: 100%; height: 100%; object-fit: cover; }
.tpg-event-card-v2 .tpg-event-body { padding: 16px 20px; }
.tpg-event-card-v2 .tpg-event-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tpg-event-card-v2 h2 { margin: 0; font-size: 1.15rem; text-align: left; color: #2a2a2a; }
.tpg-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 600;
}
.tpg-badge-actif { background: #e2f3e3; color: #2e7d32; }
.tpg-badge-inactif { background: #eee; color: #888; }
.tpg-badge-archive { background: #eee; color: #888; }

.tpg-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.tpg-mini-stat {
  background: #f4f1ea;
  border-radius: 10px;
  padding: 10px;
}
.tpg-mini-stat .tpg-mini-label { font-size: 0.75rem; color: #888; margin: 0 0 2px; }
.tpg-mini-stat .tpg-mini-value { font-size: 1.25rem; font-weight: 700; margin: 0; }

.tpg-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
}
.tpg-event-actions a, .tpg-event-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #c05a1e;
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.tpg-event-actions a:hover, .tpg-event-actions button:hover { text-decoration: underline; }

/* --- Page de connexion admin --- */
.tpg-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tpg-login-box { max-width: 400px; width: 100%; padding: 16px; }
.tpg-login-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #c05a1e;
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.tpg-login-box h1 { font-size: 1.3rem; margin-bottom: 4px; }
.tpg-login-subtitle { text-align: center; color: #888; font-size: 0.9rem; margin: 0 0 20px; }
.tpg-login-error {
  background: #fdecea;
  color: #b71c1c;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.tpg-login-hint {
  text-align: center;
  color: #999;
  font-size: 0.8rem;
  margin-top: 18px;
}

/* --- Bloc commande façon terminal (page maintenance) --- */
.tpg-terminal {
  background: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}
.tpg-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #2a2a2a;
}
.tpg-terminal-dots { display: flex; gap: 6px; }
.tpg-terminal-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tpg-terminal-dots span:nth-child(1) { background: #ff5f56; }
.tpg-terminal-dots span:nth-child(2) { background: #ffbd2e; }
.tpg-terminal-dots span:nth-child(3) { background: #27c93f; }
.tpg-terminal-copy {
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tpg-terminal-copy:hover { background: rgba(255,255,255,0.1); }
.tpg-terminal-body {
  padding: 16px;
  color: #d4d4d4;
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: pre;
}
.tpg-terminal-body .prompt { color: #6bcB77; }
