:root {
  --bg: #0d1117; --panel: #161b22; --line: #2a3138; --ink: #e6edf3;
  --muted: #8b949e; --accent: #d4a24e; --ok: #3fb950; --warn: #d29922;
  --bad: #f85149; --blocked: #8957e5; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
button { cursor: pointer; border: 1px solid var(--accent); background: var(--accent);
  color: #1a1204; padding: 8px 14px; border-radius: var(--radius); font-weight: 600; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button:hover { filter: brightness(1.08); }
input, select, textarea { background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); padding: 8px 10px; border-radius: var(--radius); font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); }
a { color: var(--accent); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; }
.login .card { display: flex; flex-direction: column; gap: 12px; width: min(340px, 90vw);
  background: var(--panel); padding: 28px; border-radius: 16px; border: 1px solid var(--line); }
.login h1 { margin: 0; letter-spacing: 1px; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { font-weight: 700; letter-spacing: 1px; color: var(--accent); }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs button { background: transparent; border: none; color: var(--muted); font-weight: 600; }
.tabs button.active { color: var(--ink); border-bottom: 2px solid var(--accent); border-radius: 0; }

.consent-banner { background: rgba(212,162,78,.12); border: 1px solid var(--accent);
  color: var(--ink); padding: 10px 16px; margin: 14px 20px; border-radius: var(--radius); font-size: 13px; }

.tab { padding: 8px 20px 60px; max-width: 1000px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-width: 420px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }

.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pcard h3 { margin: 0 0 6px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted); margin-right: 6px; }
.tag.self { border-color: var(--ok); color: var(--ok); }
.tag.brand { border-color: var(--accent); color: var(--accent); }
.tag.no-consent { border-color: var(--bad); color: var(--bad); }
.tag.consent { border-color: var(--ok); color: var(--ok); }
.pcard .actions { display: flex; gap: 8px; margin-top: 12px; }

/* Status + skeleton (réflexe UX : jamais d'écran vide qui pop) */
.status { padding: 10px 14px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); margin: 12px 0; }
.skeleton { height: 14px; border-radius: 6px; margin: 8px 0;
  background: linear-gradient(90deg, #1b2129 25%, #232b34 37%, #1b2129 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line);
  border-radius: var(--radius); margin-top: 14px; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.st { font-weight: 700; }
.st.present, .st.done { color: var(--ok); }
.st.absent { color: var(--muted); }
.st.blocked { color: var(--blocked); }
.st.error, .st.refused { color: var(--bad); }
.st.uncertain, .st.todo, .st.sent, .st.in_progress { color: var(--warn); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 20; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: min(560px, 92vw); max-height: 88vh; overflow: auto; position: relative; }
.modal-close { position: absolute; top: 10px; right: 12px; background: transparent; border: none;
  color: var(--muted); font-size: 22px; }
.modal .field { max-width: none; }
.modal label.check { flex-direction: row; align-items: center; gap: 8px; }
textarea { width: 100%; min-height: 180px; font-family: ui-monospace, monospace; }
