:root {
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --purple-500: #b400ff;
  --amber-800: #92400e;
  --green-800: #166534;
  --red-600: #dc2626;
  --red-50: #fef2f2;
  --font-serif: Georgia, Cambria, 'Times New Roman', Times, serif;
  --ink: #1a1a1a;
  --rule: #dcdcdc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
  border: 1px dashed var(--gray-300);
  background: #fff;
}

/* ---- Espace admin : même langage visuel que le site public ---- */

.admin-body { background: #fff; }

.admin-main {
  padding-bottom: 64px;
}

.admin-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin: 0;
  color: var(--ink);
}

.linklike {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.linklike:hover { text-decoration: underline; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-gradient {
  background: var(--purple-500);
  color: #fff;
  border-color: var(--purple-500);
}

.btn-gradient:hover { opacity: 0.9; }

.btn-outline {
  background: #fff;
  border: 1px solid var(--ink);
  color: var(--ink);
}

.btn-outline:hover { background: var(--gray-50); }

.btn-dark {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn-dark:hover { background: #000; }

.btn-danger {
  background: none;
  color: var(--red-600);
  border: none;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-danger:hover { text-decoration: underline; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 24px;
}

.card + .card { margin-top: 24px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="password"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 2px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.field textarea.mono { font-family: ui-monospace, Consolas, monospace; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--purple-500);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Onglets (filtres de statut, mode génération/réécriture) */
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0 0 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
}

.category-filters a {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.category-filters a:hover { color: var(--ink); }

.category-filters a.active {
  color: var(--ink);
  border-bottom-color: var(--purple-500);
}

.alert-error {
  background: var(--red-50);
  color: var(--red-600);
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-success {
  color: var(--green-800);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

thead {
  border-bottom: 1px solid var(--ink);
  text-align: left;
}

thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
}

th, td { padding: 12px 16px; }

tbody tr { border-bottom: 1px solid var(--rule); }
tbody tr:last-child { border-bottom: none; }

.status-badge {
  display: inline-block;
  border-radius: 2px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid currentColor;
  background: none;
}

.status-DRAFT { color: var(--amber-800); }
.status-PUBLISHED { color: var(--green-800); }
.status-ARCHIVED { color: var(--gray-500); }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 32px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner-dark {
  border-color: rgba(0,0,0,0.2);
  border-top-color: var(--amber-800, #92400e);
}
