:root {
  --bg: #0f1b2d;
  --bg2: #16273e;
  --card: #1b2f4a;
  --text: #f4f6f8;
  --muted: #9fb0c3;
  --gold: #d9a441;
  --gold-dark: #b0822a;
  --danger: #e05252;
  --ok: #4caf7d;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: rgba(15, 27, 45, .95);
  border-bottom: 1px solid #243a57;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
main { max-width: 560px; margin: 0 auto; padding: 16px 14px 40px; }
.view.hidden, .hidden { display: none !important; }
.card {
  background: var(--card);
  border: 1px solid #243a57;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 10px; }
p { margin: 6px 0; line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.error { color: #ff8a8a; font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }
.warn {
  background: #3a2c10; border: 1px solid var(--gold-dark);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 15px; }
input[type="text"], input[type="password"] {
  width: 100%; margin-top: 6px;
  padding: 12px; font-size: 16px;
  border-radius: 10px; border: 1px solid #35506f;
  background: var(--bg2); color: var(--text);
}
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.btn {
  display: inline-block;
  background: #2a425f; color: var(--text);
  border: 1px solid #35506f; border-radius: 10px;
  padding: 11px 16px; font-size: 16px; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none;
  margin-top: 10px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--gold); border-color: var(--gold-dark); color: #1a1206; }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; padding: 14px; font-size: 17px; }
.btn.small { padding: 7px 12px; font-size: 14px; margin-top: 0; }
.btn.danger { background: transparent; border-color: var(--danger); color: #ff8a8a; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 11px 6px; font-size: 15px; font-weight: 700;
  background: var(--bg2); color: var(--muted);
  border: 1px solid #243a57; border-radius: 10px; cursor: pointer;
}
.tab.active { background: var(--card); color: var(--text); border-color: var(--gold-dark); }
.tpl-list { display: grid; gap: 8px; }
.tpl-item {
  display: flex; justify-content: space-between; align-items: center;
  border: 2px solid #35506f; border-radius: 10px; padding: 12px;
  cursor: pointer; font-weight: 600;
}
.tpl-item.selected { border-color: var(--gold); background: #24395a; }
.tpl-item .secs { color: var(--muted); font-weight: 400; font-size: 14px; }
.filepick input[type="file"] { display: none; }
.preview {
  display: block; width: 100%; max-height: 320px; object-fit: contain;
  border-radius: 10px; margin-top: 10px; background: #000;
}
.radios label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 8px 0; }
.radios input { width: 18px; height: 18px; accent-color: var(--gold); }
.cost { font-size: 16px; margin-top: 12px; }
.bar { height: 10px; background: var(--bg2); border-radius: 6px; overflow: hidden; margin: 10px 0; }
.bar-fill { height: 100%; width: 15%; background: var(--gold); border-radius: 6px; transition: width 1s ease; }
video { width: 100%; border-radius: 10px; background: #000; max-height: 480px; }
.job { border: 1px solid #243a57; border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--card); }
.job h3 { margin: 0 0 4px; font-size: 16px; }
.job .meta { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.job .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.job .actions .btn { margin-top: 8px; }
.status-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: #2a425f;
}
.status-pill.listo { background: #1d4a32; color: #b9e8cd; }
.status-pill.fallo { background: #4a1d1d; color: #ffb3b3; }
.tpl-admin-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid #243a57; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.tpl-admin-row .btn { margin-top: 0; padding: 7px 10px; font-size: 14px; }
