/* Back office Que les Potes : mêmes tokens que l'app (apps/mobile/src/theme/tokens.ts). */
:root {
  --ink: #0d0d0d;
  --white: #ffffff;
  --surface: #f2f2f2;
  --warm150: #efede8;
  --border: #e8e6e1;
  --text2: #6e6a63;
  --text3: #a39e95;
  --taupe: #8c8270;
  --red: #ef4444;
  --green: #6bb38a;
  --green-dark: #3e8e63;
  --orange: #f28c28;
  --radius: 22px;
  --radius-sm: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface);
  color: var(--ink);
  font: 16px/1.45 'DM Sans', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 28px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.3px; }
h2 { font-size: 19px; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--text2); }
.small { font-size: 13px; }

.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--white); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand em { font-style: normal; font-size: 12px; color: var(--white); background: var(--ink); border-radius: 999px; padding: 2px 8px; }
#who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text2); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 80px; }

.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stack > * + * { margin-top: 12px; }

button, .btn {
  white-space: nowrap;
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 500;
  border-radius: 999px; padding: 11px 20px; background: var(--ink); color: var(--white);
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
button.secondary, .btn.secondary { background: var(--surface); color: var(--ink); }
button.ghost { background: transparent; color: var(--ink); padding: 8px 12px; min-height: 0; }
button.danger { background: var(--red); }
button:disabled { opacity: 0.45; cursor: default; }
button.small { padding: 6px 12px; min-height: 32px; font-size: 14px; }

label { display: block; font-size: 14px; color: var(--text2); margin-bottom: 4px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
textarea { min-height: 110px; resize: vertical; }
.field { min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; margin: 0; }
.check input { width: auto; }
.hint { font-size: 13px; color: var(--text3); margin-top: 4px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--warm150); color: var(--text2); white-space: nowrap; }
.pill.ok { background: #e6f3ec; color: var(--green-dark); }
.pill.off { background: #fde8e8; color: #b42318; }
.pill.wait { background: #fdf0e3; color: #9a4f05; }
.pill.dark { background: var(--ink); color: var(--white); }

.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat b { display: block; font-size: 30px; font-weight: 600; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--text2); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--text2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; letter-spacing: 0.5px; }

.campaign { display: block; text-decoration: none; }
.campaign:hover { border-color: var(--ink); }
.campaign h2 { margin-bottom: 4px; }

.error { background: #fde8e8; color: #b42318; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.notice { background: var(--warm150); color: var(--text2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }

.login { max-width: 420px; margin: 12vh auto 0; text-align: center; }
.login img { margin-bottom: 16px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: var(--white); border-radius: 999px; padding: 12px 20px; font-size: 15px;
  transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  main { padding: 16px 16px 64px; }
  .card { padding: 16px; }
  h1 { font-size: 24px; }
  #who .email { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .wide { display: none; }
  td { padding: 10px 6px; }
}
