:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1a1c22;
  --muted: #6b7080;
  --line: #e3e5ea;
  --accent: #e5004b;
  --accent-dark: #b8003c;
  --ok: #1a7f37;
  --warn: #9a6700;
  --danger: #c62828;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: #2457c5; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; }
section { margin-bottom: 1.25rem; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1200px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { padding: 1.5rem 0; }
.crumbs { margin: .5rem 0 1rem; color: var(--muted); }

/* topo */
.top { background: #111318; color: #fff; margin-bottom: 1.5rem; }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 56px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; letter-spacing: .2px; }
.brand::before { content: "●"; color: var(--accent); margin-right: .5rem; }
.top nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; margin-left: auto; }
.top nav a, .top nav button.link { color: #c9ccd6; padding: .4rem .7rem; border-radius: 8px; font-size: .95rem; }
.top nav a.on { color: #fff; background: #262a33; }
.top nav a:hover, .top nav button.link:hover { color: #fff; text-decoration: none; background: #262a33; }

/* cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.hero h1 { margin-bottom: .75rem; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat dt { color: var(--muted); font-size: .85rem; }
.stat dd { margin: 0; font-size: 1.5rem; font-weight: 600; }

/* formulários */
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  font: inherit; padding: .55rem .7rem; border: 1px solid #cfd3db; border-radius: 8px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9db6ff; outline-offset: 0; border-color: #6f8fe0; }
label { display: block; font-size: .9rem; color: #353945; }
label > input, label > select, label > textarea { margin-top: .25rem; }
.stack label { margin-bottom: .8rem; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap { margin-top: .75rem; }
.row.wrap-row { flex-wrap: wrap; }
.row > input[type=text], .row > input[type=email], .row > input[type=search] { flex: 1 1 200px; }
.row > input[size] { flex: 0 0 auto; width: auto; }
.grow { flex: 1; }
.inline { display: inline; }
.inline-row { max-width: 320px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; align-items: end; }
.filters .actions { display: flex; gap: .5rem; }
button, .button {
  font: inherit; cursor: pointer; display: inline-block; padding: .55rem 1rem; border-radius: 8px;
  border: 1px solid #cfd3db; background: #fff; color: var(--text); white-space: nowrap; text-decoration: none;
}
button:hover, .button:hover { background: #f1f2f5; text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover, .button.primary:hover { background: var(--accent-dark); }
button.danger { background: #fff; border-color: #e6b3b3; color: var(--danger); }
button.danger:hover { background: #fdeeee; }
button.small, .button.small { padding: .35rem .7rem; font-size: .85rem; }
button.link { background: none; border: 0; padding: 0; color: #2457c5; cursor: pointer; }
button.link:hover { text-decoration: underline; background: none; }
button.link.danger { color: var(--danger); }
button[disabled] { opacity: .6; cursor: progress; }

/* avisos */
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: #eaf7ee; border-color: #b7e1c3; color: #155724; }
.flash.erro { background: #fdecec; border-color: #f3b5b5; color: #8a1c1c; }
.flash.info { background: #eef3fd; border-color: #c3d3f5; color: #1f3d7a; }

/* autenticação */
.auth { max-width: 380px; margin: 3rem auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.auth label { margin-bottom: .9rem; }
.auth button { width: 100%; margin-top: .25rem; }

/* gravações em andamento */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.job-head { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .75rem; }
.rec { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: .45rem; flex: 0 0 auto; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; margin: 0 0 1rem; }
.stats dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.stats dd { margin: 0; font-weight: 600; }
.badge { display: inline-block; font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; background: #e9ecf3; color: #3c4356; vertical-align: middle; }
.badge.st-erro { background: #fdecec; color: var(--danger); }
.badge.st-gravando { background: var(--accent); color: #fff; }
.badge.st-finalizando { background: #fff3cd; color: var(--warn); }
.live { color: var(--accent); font-weight: 600; }
.warn { color: var(--warn); }

/* grade de vídeos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.card.video { padding: 0; overflow: hidden; color: inherit; display: flex; flex-direction: column; transition: transform .1s, box-shadow .1s; }
.card.video:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.thumb { position: relative; aspect-ratio: 9 / 12; background: #1a1c22; display: flex; align-items: center; justify-content: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nothumb { color: #8a90a0; font-size: 1.6rem; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); color: #fff; font-size: .75rem; padding: .1rem .4rem; border-radius: 4px; }
.thumb .badge { position: absolute; left: 8px; top: 8px; }
.card.video .body { padding: .7rem .8rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.card.video .title { color: #353945; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.chip { display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 999px; background: #eef3fd; color: #1f3d7a; border: 1px solid #d5e0f7; }

/* página do vídeo */
.video-page { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
video#player { width: 100%; max-height: 75vh; background: #000; border-radius: var(--radius); display: block; }
.player-empty { aspect-ratio: 9/16; max-height: 60vh; background: #1a1c22; color: #8a90a0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.details { margin: 1rem 0 0; display: grid; gap: .6rem; }
.details div { display: grid; grid-template-columns: 150px 1fr; gap: .5rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.notes { white-space: pre-wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.prodlist { list-style: none; padding: 0; margin: 0 0 1rem; }
.prodlist li { display: flex; gap: .7rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.prodlist .time { font-variant-numeric: tabular-nums; min-width: 3.6rem; font-weight: 600; }
.danger-zone { border-color: #f0d0d0; background: #fff8f8; }

/* tabelas */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; }
.table th, .table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); background: #fafbfc; }
.table tr:last-child td { border-bottom: 0; }
.avatar { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: #262a33; color: #fff; align-items: center; justify-content: center; font-weight: 700; }

footer { margin: 2rem auto 1.5rem; }

@media (max-width: 760px) {
  .video-page { grid-template-columns: 1fr; }
  .details div { grid-template-columns: 1fr; gap: 0; }
  .table thead { display: none; }
  .table tr { display: block; padding: .5rem 0; }
  .table td { display: block; border: 0; padding: .25rem .9rem; }
  .table tr + tr { border-top: 1px solid var(--line); }
  .top .wrap { gap: .5rem; }
  .top nav { margin-left: 0; width: 100%; padding-bottom: .5rem; }
}
