/* admin.css — Console admin SAGIP'26
   Pendant éditorial du client : même typo, mais palette plus marquée
   (intention "salle de contrôle de revue scientifique"). */
:root {
  --bg:#0B1326;
  --bg-2:#0F1B3D;
  --paper:#F7F4EC;
  --paper-2:#EFE9DA;
  --fg:#ECEFFA;
  --muted:#8A93B5;
  --accent:#F2B400;
  --accent-2:#C97900;
  --brand:#1F4FBF;
  --brand-2:#5CC6F5;
  --line:#1E2A4E;
  --card:#152044;
  --input:#0A1228;
  --ok:#3FBE85;
  --err:#E8635A;

  --ff-display:"Fraunces","Georgia",serif;
  --ff-sans:"DM Sans",system-ui,sans-serif;
  --ff-mono:"JetBrains Mono",ui-monospace,monospace;
}

* { box-sizing: border-box; }
body {
  font-family: var(--ff-sans);
  margin: 0;
  background:
    radial-gradient(1000px 700px at 90% -10%, rgba(92,198,245,.06), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(242,180,0,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg); font-size: 14.5px; line-height: 1.55; min-height: 100vh;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.bar {
  background: linear-gradient(135deg, #07123A, var(--bg-2));
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 1.2rem;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07123A; display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display); font-size: 1.3rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(242,180,0,.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--ff-display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: -.01em;
}
.brand-text em {
  font-style: italic; font-family: var(--ff-display); font-weight: 400;
  font-size: .78rem; color: var(--muted);
}

.role { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.role-tag {
  background: var(--card); padding: .35rem .75rem; border-radius: 4px;
  font-size: .78rem; border: 1px solid var(--line);
  font-family: var(--ff-mono); letter-spacing: .04em;
}
.role-tag.super {
  background: var(--accent); color: #2C2400; border-color: var(--accent);
  font-weight: 600;
}
.role-tag.admin {
  background: var(--brand); color: #fff; border-color: var(--brand);
  font-weight: 500;
}

main { max-width: 1150px; margin: 2rem auto; padding: 0 1.5rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.eyebrow {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin-bottom: .35rem;
}
h2 {
  margin: 0 0 .8rem;
  font-family: var(--ff-display); font-weight: 500;
  font-size: 1.5rem; letter-spacing: -.015em; color: var(--fg);
}
.muted { color: var(--muted); font-size: .88rem; font-family: var(--ff-display); font-style: italic; }

label {
  display: block; margin: .8rem 0;
  font-family: var(--ff-mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
input, select {
  display: block; width: 100%; padding: .6rem .85rem;
  background: var(--input); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-family: var(--ff-display); font-weight: 400;
  font-size: .96rem; margin-top: .3rem;
  transition: border-color .15s;
}
input:focus, select:focus {
  outline: 0; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(92,198,245,.16);
}

button {
  background: var(--brand); color: #fff; border: 0;
  padding: .55rem 1rem; border-radius: 6px; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 500;
  font-family: var(--ff-sans);
  margin: .25rem .25rem .25rem 0;
  transition: background .15s, transform .1s;
}
button:hover { background: #2865d6; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--fg);
}
button.ghost:hover { background: var(--card); }
button.accent {
  background: var(--accent); color: #2C2400; font-weight: 600;
}
button.accent:hover { background: var(--accent-2); color: #fff; }
button.tiny { padding: .3rem .65rem; font-size: .78rem; }

.actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
#auth-msg { margin-top: .8rem; }

.err, .ok {
  padding: .65rem .9rem; border-radius: 6px;
  font-size: .88rem; font-family: var(--ff-sans);
}
.err { background: rgba(232,99,90,.15); color: var(--err); border: 1px solid rgba(232,99,90,.3); }
.ok  { background: rgba(63,190,133,.15); color: var(--ok); border: 1px solid rgba(63,190,133,.3); }

.tabs {
  display: flex; gap: .25rem; margin: 0 0 1.2rem;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.tabs button {
  background: transparent; color: var(--muted);
  padding: .65rem 1rem; border-radius: 6px 6px 0 0;
  border-bottom: 3px solid transparent;
  font-family: var(--ff-display); font-weight: 500; font-size: .92rem;
  margin: 0; letter-spacing: -.005em;
}
.tabs button:hover { color: var(--fg); background: var(--card); transform: none; }
.tabs button.active {
  color: var(--accent); border-bottom-color: var(--accent); background: var(--card);
}

.filters {
  display: flex; gap: 1rem; align-items: end; flex-wrap: wrap;
}
.filters label { flex: 0 0 200px; margin: 0; }
.filters button { margin: 0; align-self: stretch; }
.filters #meta {
  margin-left: auto; font-size: .82rem; color: var(--muted);
  font-family: var(--ff-mono); letter-spacing: .04em;
  align-self: center;
}

table {
  width: 100%; border-collapse: collapse;
  font-size: .88rem; font-family: var(--ff-sans);
}
th, td {
  padding: .65rem .75rem; text-align: left;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
th {
  color: var(--muted); font-family: var(--ff-mono); font-weight: 500;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
}
td code {
  background: var(--input); padding: 1px 6px; border-radius: 3px;
  font-size: .78rem; font-family: var(--ff-mono);
}
tbody tr:hover { background: rgba(31,79,191,.07); }

.pill {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  font-family: var(--ff-mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .04em; margin: 1px;
}
.pill-consent { background: rgba(63,190,133,.18); color: var(--ok); }
.pill-no { background: var(--input); color: var(--muted); }
.pill-ct { background: rgba(242,180,0,.16); color: var(--accent); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.2rem 1.3rem;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at center, rgba(242,180,0,.1), transparent 70%);
}
.stat .v {
  font-family: var(--ff-display);
  font-variation-settings: "opsz" 144;
  font-size: 2.6rem; font-weight: 600;
  color: var(--accent); line-height: 1; letter-spacing: -.03em;
}
.stat .l {
  font-family: var(--ff-mono);
  font-size: .68rem; color: var(--muted);
  margin-top: .6rem; letter-spacing: .1em; text-transform: uppercase;
}

.ct-bars { display: grid; gap: .45rem; max-width: 700px; }
.ct-bar {
  display: grid; grid-template-columns: 120px 1fr 40px; gap: .6rem;
  align-items: center; font-size: .85rem;
}
.ct-bar strong {
  font-family: var(--ff-display); font-weight: 500;
  color: var(--fg); letter-spacing: -.005em;
}
.ct-bar .bar-bg {
  background: var(--input); border-radius: 4px; height: 20px;
  position: relative; overflow: hidden;
}
.ct-bar .bar-fill {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  height: 100%; border-radius: 4px;
  transition: width .4s ease;
}
.ct-bar .bar-val {
  text-align: right; font-family: var(--ff-mono); font-size: .82rem;
  font-weight: 600; color: var(--accent);
}

.empty {
  padding: 3rem 1rem; text-align: center; color: var(--muted);
  font-family: var(--ff-display); font-style: italic; font-size: 1.05rem;
}
.text-pre {
  white-space: pre-wrap; font-size: .92rem;
  font-family: var(--ff-display); font-weight: 400; line-height: 1.5;
}

.q-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .9rem 1.1rem; margin-bottom: .6rem;
}
.q-item .q-head {
  display: flex; gap: .6rem; align-items: center;
  font-family: var(--ff-mono); font-size: .7rem; letter-spacing: .04em;
  color: var(--muted); margin-bottom: .4rem;
}
.q-item .q-text {
  font-family: var(--ff-display); font-weight: 400;
  font-size: 1rem; line-height: 1.45;
}
.q-item .q-anon {
  background: rgba(242,180,0,.18); color: var(--accent);
  padding: 1px 7px; border-radius: 3px; font-weight: 600;
}
