@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
:root {
  --paper: #f6f7fb;
  --surface: #ffffff;
  --raised: #f0f3fa;
  --ink: #0b1020;
  --text-2: #4a5468;
  --text-3: #8690a6;
  --hair: rgba(11, 16, 32, .07);
  --hair-2: rgba(11, 16, 32, .13);
  --azure: #1f6bff;
  --violet: #8f6bff;
  --green: #12b76a;
  --red: #e5484d;
  --amber: #c98a00;
  --r: 14px;
  --font: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 26px; }
h2 { font-size: 16px; }
p { margin: 0; }
a { color: var(--azure); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* Coquille */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; background: var(--surface); border-right: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 0 10px; }
.brand .muted { font-weight: 500; }
.dot { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--azure), var(--violet)); }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
#nav a:hover { background: var(--raised); color: var(--ink); }
#nav a.on { background: var(--ink); color: #fff; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 10px; }
.main { padding: 30px 36px 60px; min-width: 0; outline: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { color: var(--text-2); margin-top: 6px; }
.crumb { font-size: 13px; color: var(--text-3); margin-bottom: 6px; display: inline-block; }

/* Blocs */
.card { background: var(--surface); border-radius: var(--r); box-shadow: 0 0 0 1px var(--hair); padding: 18px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.card h2 { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--text-2); font-size: 13px; }
.kpi .value { font-size: 28px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--text-3); font-size: 12px; }
.kpi .sub b { color: var(--text-2); font-weight: 600; }

/* Tableaux */
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { padding-left: 18px; }
td:last-child, th:last-child { padding-right: 18px; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: #f8f9fd; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.ellip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pastilles d'état */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--raised); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.done, .pill.ok, .pill.published, .pill.active { color: var(--green); background: rgba(18, 183, 106, .1); }
.pill.failed, .pill.bad, .pill.rejected { color: var(--red); background: rgba(229, 72, 77, .1); }
.pill.running, .pill.queued, .pill.live, .pill.still, .pill.video { color: var(--azure); background: rgba(31, 107, 255, .1); }
.pill.warn, .pill.canceled, .pill.past_due { color: var(--amber); background: rgba(201, 138, 0, .12); }

/* Filtres et formulaires */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
input[type="search"], input[type="text"], input[type="email"], input[type="number"], select, textarea {
  height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair-2); min-width: 0;
}
textarea { height: auto; padding: 10px 12px; }
input[type="search"] { width: 280px; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--azure); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.btn { height: 36px; padding: 0 14px; border-radius: 10px; border: 0; cursor: pointer; font-weight: 550; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair-2); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #222a40; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.linkish { border: 0; background: none; padding: 0; color: var(--azure); cursor: pointer; text-align: left; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair-2); cursor: pointer; font-size: 13px; color: var(--text-2); }
.chips button.on { background: var(--ink); color: #fff; box-shadow: none; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--text-3); font-size: 13px; }
.pager div { display: flex; gap: 8px; }

/* Graphiques */
.chart { width: 100%; height: 120px; display: block; }
.chart .bar-r { fill: var(--azure); }
.chart .bar-r.alt { fill: var(--violet); }
.chart .bar-r.bad { fill: var(--red); }
.chart .base { stroke: var(--hair-2); }
.chart-foot { display: flex; justify-content: space-between; color: var(--text-3); font-size: 11px; margin-top: 4px; }

/* Détail */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
pre { margin: 0; padding: 14px; border-radius: 10px; background: #0b1020; color: #dfe6ff; font-size: 12px; line-height: 1.55; overflow: auto; max-height: 420px; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.media figure { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.media video, .media img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: #0b1020; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--hair); overflow: hidden; display: flex; flex-direction: column; }
.tile.off { opacity: .55; }
.tile video, .tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #0b1020; display: block; }
.tile .t-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.tile .t-body b { font-size: 13px; }
.tile .t-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.check:last-child { border-bottom: 0; }
.empty { padding: 30px; text-align: center; color: var(--text-3); }
.msg { font-size: 13px; color: var(--text-2); min-height: 1em; }
.msg.bad { color: var(--red); }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 20px; box-shadow: 0 0 0 1px var(--hair), 0 20px 50px rgba(24, 48, 130, .08); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login-card .brand { padding: 0; }
.login-card .btn { height: 42px; justify-content: center; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 10; }
.toast.bad { background: var(--red); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 14px; gap: 12px; }
  #nav { flex-direction: row; overflow-x: auto; }
  #nav a { white-space: nowrap; }
  .side-foot { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .main { padding: 20px 14px 40px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  input[type="search"] { width: 100%; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}
.neg { color: var(--red); } .pos { color: var(--green); }
.grid > .card { margin-top: 0; }
.check a, .head p, .kpi .value { overflow-wrap: anywhere; }
