:root {
  --green: #157a35; --deep: #0b4d22; --orange: #f0611c; --yellow: #f7d93b;
  --ink: #15201a; --muted: #5d6b62; --line: #dfe6e1; --bg: #f3f6f4; --card: #fff;
  --ok: #157a35; --warn: #c7731a; --err: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: "Archivo", system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--deep); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; background: #e9efeb; padding: .05em .35em; border-radius: 4px; }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--deep); color: #d9e9de; padding: 1.1rem 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .brand { display: flex; align-items: center; gap: .7rem; padding: 0 1.1rem 1rem; color: #fff; text-decoration: none; }
.side .brand img { width: 46px; height: 46px; object-fit: contain; }
.side .brand b { display: block; font-size: 1.05rem; }
.side .brand span { font-size: .8rem; color: #9fc6ab; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: .55rem 1.1rem; color: #d9e9de; text-decoration: none; border-left: 3px solid transparent; }
.side nav a:hover { background: rgba(255,255,255,.06); }
.side nav a.active { background: rgba(255,255,255,.1); border-left-color: var(--yellow); color: #fff; }
.side .badge { background: var(--orange); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .1em .55em; }
.side .foot { margin-top: auto; padding: 1rem 1.1rem 0; font-size: .8rem; color: #9fc6ab; }
.side .foot a { color: #d9e9de; }
.flag { height: 6px; background: repeating-linear-gradient(90deg, var(--orange) 0 22px, var(--yellow) 22px 44px); }

.main { padding: 1.5rem 2rem 3rem; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .6rem .9rem; border-radius: var(--radius); background: #e4f1e8; border: 1px solid #bcd9c5; margin-bottom: .4rem; }
.messages li.error { background: #fbe7e5; border-color: #f0b8b3; }
.messages li.info { background: #fff6d6; border-color: #ead98e; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.card .n { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--deep); }
.card .l { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.card.hot { border-color: var(--orange); }
.card.hot .n { color: var(--orange); }

.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; }
.grid2 > .card { padding: 1rem 1.1rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1.25rem; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.status { display: inline-block; padding: .12em .55em; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: #e6ebe8; color: #334; }
.status.published { background: #dcefe2; color: var(--deep); }
.status.ready { background: var(--yellow); color: #4a3b00; }
.status.needs_audio, .status.failed { background: #fbe0d4; color: #8a3a0b; }
.status.live { background: var(--orange); color: #fff; }
.status.upcoming, .status.detected { background: #e6ebe8; }
.status.fetching, .status.processing { background: #dde8f7; color: #1d3d6b; }
.status.hidden { background: #eee; color: #777; }
.status.draft { background: #eee; }
.status.approved { background: var(--yellow); color: #4a3b00; }
.status.posted, .status.scheduled { background: #dcefe2; color: var(--deep); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .45rem; vertical-align: middle; background: #c4ccc7; }
.dot.ok { background: var(--ok); } .dot.error { background: var(--err); } .dot.missing { background: #c4ccc7; }

form.inline { display: inline; }
.btn { display: inline-block; font: inherit; font-weight: 700; padding: .5rem .95rem; border-radius: 8px; border: 1px solid var(--deep); background: var(--deep); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green); border-color: var(--green); }
.btn.secondary { background: #fff; color: var(--deep); }
.btn.secondary:hover { background: #eef4f0; }
.btn.orange { background: var(--orange); border-color: var(--orange); }
.btn.danger { background: #fff; color: var(--err); border-color: #e3b0ac; }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 600; font-size: .85rem; margin: .7rem 0 .25rem; }
input[type=text], input[type=url], input[type=email], input[type=number], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid #c7d1cb; border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.help { color: var(--muted); font-size: .82rem; margin: .25rem 0 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.check input { width: auto; }

.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters a { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: .85rem; }
.filters a.active { background: var(--deep); color: #fff; border-color: var(--deep); }
.filters input { width: auto; }

.thumbs { display: grid; grid-template-columns: 2fr 1.1fr .65fr; gap: .6rem; align-items: start; }
.thumbs img { border-radius: 6px; border: 1px solid var(--line); }
.ep-head { display: flex; gap: 1rem; align-items: flex-start; }
.ep-head img { width: 220px; border-radius: 8px; }
.err { background: #fbe7e5; border: 1px solid #f0b8b3; border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; }
.note { background: #fff6d6; border: 1px solid #ead98e; border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; }
.log li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.log li time { color: var(--muted); font-size: .8rem; margin-right: .5rem; white-space: nowrap; }
.log li.error { color: var(--err); } .log li.warning { color: var(--warn); }
.log { list-style: none; padding: 0; margin: 0; }
.integ { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.integ:last-child { border-bottom: 0; }
.integ .who { font-size: .78rem; color: var(--muted); }
.integ .who b { color: var(--orange); }
.login { max-width: 360px; margin: 10vh auto; }
.login .panel { padding: 1.5rem; }
.login img { width: 90px; display: block; margin: 0 auto 1rem; }

@media print {
  .side, .page-head .actions, .filters, .messages { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 1rem; }
  .grid2, .thumbs { grid-template-columns: 1fr; }
  .integ { grid-template-columns: 1fr; }
}
