/* =====================================================================
   Administration — identité sombre, encre et or
   ===================================================================== */

:root {
  --a-fond: #14110d;
  --a-panneau: #221d18;
  --a-panneau-2: #2c2620;
  --a-ligne: rgba(247, 242, 232, 0.12);
  --a-ligne-forte: rgba(247, 242, 232, 0.22);
  --a-texte: #f6f1e7;
  --a-texte-doux: rgba(246, 241, 231, 0.68);
  --a-or: #d9a642;
  --a-terre: #c26440;
  --a-sauge: #6f9d74;
  --a-rouge: #d4674d;
  --a-nav-h: 62px;
}

* { box-sizing: border-box; }

body.admin {
  margin: 0;
  background: var(--a-fond);
  color: var(--a-texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: calc(var(--a-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  overflow-x: hidden;
}
body.admin.center-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 18px; }
[hidden] { display: none !important; }

body.admin h1, body.admin h2, body.admin h3, body.admin h4 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600; margin: 0 0 .5em; line-height: 1.2; color: #fff;
}
body.admin h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
body.admin h2 { font-size: clamp(1.2rem, 4vw, 1.5rem); }
body.admin h3 { font-size: 1.1rem; }
body.admin h4 { font-size: .98rem; font-family: inherit; font-weight: 700; }
body.admin p { margin: 0 0 1em; }
body.admin a { color: var(--a-or); text-decoration: none; }
body.admin img { max-width: 100%; display: block; }
body.admin .muted { color: var(--a-texte-doux); }
body.admin .small { font-size: .85rem; }
body.admin .tiny { font-size: .76rem; }
body.admin .center { text-align: center; }

.a-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.a-section { padding: 20px 0; }
.a-section-tight { padding: 12px 0; }

.a-entete {
  position: sticky; top: 0; z-index: 60;
  background: rgba(20, 17, 13, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--a-ligne);
  padding-top: env(safe-area-inset-top, 0px);
}
.a-entete-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 8px 16px; max-width: 1080px; margin: 0 auto; }
.a-marque { display: flex; align-items: center; gap: 10px; min-width: 0; }
.a-marque svg { width: 30px; height: 30px; flex: 0 0 auto; }
.a-marque-txt { display: flex; flex-direction: column; min-width: 0; }
.a-marque-nom { font-family: "Iowan Old Style", Georgia, serif; font-size: 1rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-marque-sous { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--a-or); }

.a-navbas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: rgba(34, 29, 24, 0.98);
  border-top: 1px solid var(--a-ligne);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.a-navbas-in { display: grid; grid-template-columns: repeat(5, 1fr); max-width: 620px; margin: 0 auto; }
.a-navbas a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--a-nav-h); padding: 9px 2px 8px; color: var(--a-texte-doux); font-size: .63rem; font-weight: 600;
}
.a-navbas svg { width: 21px; height: 21px; }
.a-navbas a.actif { color: var(--a-or); }

.a-carte {
  background: var(--a-panneau); border: 1px solid var(--a-ligne); border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.a-carte-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.a-stats { display: grid; grid-template-columns: 1fr; gap: 10px; }
.a-stat { background: var(--a-panneau); border: 1px solid var(--a-ligne); border-radius: 14px; padding: 14px 16px; }
.a-stat b { display: block; font-family: "Iowan Old Style", Georgia, serif; font-size: 1.7rem; color: var(--a-or); line-height: 1.1; }
.a-stat span { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--a-texte-doux); }
.a-stat.alerte b { color: var(--a-rouge); }

.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 16px; border-radius: 999px; border: 1px solid transparent;
  background: var(--a-or); color: #201a12; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
  text-align: center; line-height: 1.2;
}
.a-btn:hover { filter: brightness(1.06); }
.a-btn:disabled { opacity: .5; cursor: not-allowed; }
.a-btn-large { width: 100%; padding: 15px; font-size: .98rem; }
.a-btn-clair { background: transparent; border-color: var(--a-ligne-forte); color: var(--a-texte); }
.a-btn-clair:hover { background: rgba(246, 241, 231, 0.06); }
.a-btn-danger { background: transparent; border-color: rgba(212, 103, 77, .55); color: var(--a-rouge); }
.a-btn-sm { padding: 7px 12px; font-size: .8rem; }

.a-field { margin-bottom: 14px; }
.a-field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 6px; color: var(--a-texte-doux); }
.a-field .aide { font-size: .74rem; color: var(--a-texte-doux); margin-top: 5px; }
body.admin input[type="text"], body.admin input[type="email"], body.admin input[type="password"],
body.admin input[type="number"], body.admin input[type="date"], body.admin input[type="time"],
body.admin input[type="url"], body.admin select, body.admin textarea {
  width: 100%; padding: 12px 13px; border-radius: 10px; border: 1px solid var(--a-ligne-forte);
  background: var(--a-panneau-2); color: var(--a-texte); font: inherit; font-size: .93rem;
}
body.admin textarea { min-height: 110px; resize: vertical; }
body.admin input:focus, body.admin select:focus, body.admin textarea:focus {
  outline: 2px solid rgba(217, 166, 66, .45); outline-offset: 1px; border-color: var(--a-or);
}
body.admin input[type="file"] { font-size: .84rem; padding: 10px; border: 1px dashed var(--a-ligne-forte); border-radius: 10px; width: 100%; background: var(--a-panneau-2); color: var(--a-texte); }
.a-duo { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.a-check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--a-texte-doux); }
.a-check input { width: 20px; height: 20px; accent-color: var(--a-or); margin-top: 2px; }

.a-tableau-wrap { overflow-x: auto; border: 1px solid var(--a-ligne); border-radius: 12px; background: var(--a-panneau); }
table.a-tableau { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 620px; }
table.a-tableau th, table.a-tableau td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--a-ligne); vertical-align: middle; }
table.a-tableau th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--a-texte-doux); background: var(--a-panneau-2); }
table.a-tableau tr:last-child td { border-bottom: 0; }
table.a-tableau td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.a-tableau img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.a-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--a-panneau-2); color: var(--a-texte-doux); border: 1px solid var(--a-ligne); }
.a-badge-or { background: rgba(217,166,66,.16); color: var(--a-or); }
.a-badge-sauge { background: rgba(111,157,116,.18); color: var(--a-sauge); }
.a-badge-rouge { background: rgba(212,103,77,.18); color: var(--a-rouge); }

.a-puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.a-puces::-webkit-scrollbar { display: none; }
.a-puce { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--a-ligne-forte); background: transparent; color: var(--a-texte-doux); font-size: .84rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.a-puce.actif { background: var(--a-or); border-color: var(--a-or); color: #201a12; }

#a-toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--a-nav-h) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.a-toast { background: #2c2620; color: var(--a-texte); padding: 12px 14px; border-radius: 10px; font-size: .88rem; border-left: 4px solid var(--a-or); box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: a-toast .25s ease; }
.a-toast.ok { border-left-color: var(--a-sauge); }
.a-toast.erreur { border-left-color: var(--a-rouge); }
@keyframes a-toast { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.a-sheet-fond { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 300; display: flex; align-items: flex-end; }
.a-sheet { background: var(--a-panneau); width: 100%; max-width: 620px; margin: 0 auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px)); max-height: 90vh; overflow-y: auto; animation: a-sheet .28s ease; }
@keyframes a-sheet { from { transform: translateY(28px); opacity: .7; } to { transform: none; opacity: 1; } }

.a-alerte { border-radius: 10px; padding: 12px 14px; font-size: .88rem; margin-bottom: 14px; border: 1px solid; }
.a-alerte-ok { background: rgba(111,157,116,.14); border-color: rgba(111,157,116,.45); color: #a8d0ac; }
.a-alerte-erreur { background: rgba(212,103,77,.14); border-color: rgba(212,103,77,.45); color: #eda48f; }
.a-alerte-info { background: rgba(217,166,66,.12); border-color: rgba(217,166,66,.4); color: #e8cd97; }

.a-connexion { width: 100%; max-width: 420px; }
.a-connexion .a-logo { width: 62px; height: 62px; margin: 0 auto 16px; }
.a-connexion input { text-align: left; }

@media (min-width: 620px) {
  .a-stats { grid-template-columns: repeat(3, 1fr); }
  .a-duo { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .a-stats { grid-template-columns: repeat(4, 1fr); }
}
