/* Back-office client (référentiel §10) — interface utilitaire, volontairement sobre : ce n'est pas le
   site vitrine (pas de polices ni de design par réglages ici), seulement un outil de travail clair. */

:root {
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #fafaf9;
  --panel: #ffffff;
  --brand: #1e40af;
  --brand-soft: #eff2fb;
  --danger: #b91c1c;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar h1 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0.5rem 1rem;
}

.sidebar button {
  text-align: left;
  border: none;
  background: none;
  font: inherit;
  color: var(--ink);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.sidebar button:hover {
  background: var(--brand-soft);
}

.sidebar button[aria-current="true"] {
  background: var(--brand);
  color: white;
  font-weight: 600;
}

main {
  padding: 2rem 2.5rem;
  max-width: 780px;
}

main > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

main > header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="time"],
input[type="date"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: white;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.field {
  margin-bottom: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.row > * {
  flex: 1;
}

.row .icon-btn {
  flex: 0 0 auto;
}

.icon-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.icon-btn.danger:hover {
  background: #fee2e2;
  color: var(--danger);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: 600;
}

.btn.ghost {
  border-color: transparent;
  color: var(--brand);
}

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

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

/* Écran de connexion (référentiel §10) */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 360px;
  width: 100%;
}

.login-card h1 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.login-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

.sidebar .logout {
  margin-top: auto;
  color: var(--muted);
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.status {
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  white-space: nowrap;
}

.status.published {
  background: #dcfce7;
  color: #166534;
}

.week-day {
  display: grid;
  /* minmax(0, 1fr), pas 1fr seul : sans quoi le contenu (2 créneaux) force la piste à s'élargir
     au-delà de l'espace disponible et repousse la case « Fermé » hors de vue. */
  grid-template-columns: 6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.week-day .row {
  flex-wrap: wrap;
}

.week-day:last-child {
  border-bottom: none;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.preset-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  background: white;
}

.preset-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.preset-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.preset-card span {
  font-size: 0.82rem;
  color: var(--muted);
}

.swatch-grid {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.swatch {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-align: center;
  border: 1px dashed var(--line);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: none;
}

/* Statistiques (référentiel §11 bis, ajouté le 29/09/2026) : repris à l'identique d'apps/admin/styles.css */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
