:root {
  --bg: #06080f;
  --panel: rgba(15, 20, 35, 0.75);
  --border: rgba(120, 154, 255, 0.22);
  --text: #dce6ff;
  --muted: #99aacd;
  --accent: #4de2ff;
  --accent2: #7c67ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 700px at 10% 0%, #131b33 0%, transparent 60%),
              radial-gradient(1000px 600px at 90% 0%, #2a1542 0%, transparent 60%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(141, 173, 255, 0.08) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(141, 173, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

.container {
  width: min(1200px, 94vw);
  margin: 26px auto 40px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  letter-spacing: 0.4px;
}
.hero p { margin: 0; color: var(--muted); }
.inline-form { margin-top: 12px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.full { grid-column: 1 / -1; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}
.field input, .field select {
  width: 100%;
  background: rgba(7, 11, 22, 0.78);
  color: var(--text);
  border: 1px solid rgba(145, 176, 255, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips label {
  background: rgba(11, 16, 30, 0.7);
  border: 1px solid rgba(125, 165, 255, 0.28);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--text);
  margin: 0;
}

.actions { display: flex; justify-content: flex-end; }
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  color: #05111f;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent), #9df2ff 70%);
  text-decoration: none;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(145, 176, 255, 0.35);
}
.btn.danger {
  border-color: rgba(255, 91, 91, 0.45);
  color: #ffd2d2;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.toolbar h2 { margin: 0; font-size: 1rem; color: var(--muted); }
.toolbar-actions { display: flex; gap: 8px; }
.muted { color: var(--muted); font-size: 0.85rem; }

.table-wrap { overflow: auto; margin-top: 14px; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}
th, td {
  padding: 10px;
  border-bottom: 1px solid rgba(126, 156, 245, 0.18);
  text-align: left;
  vertical-align: top;
}
th { color: #a9bdf3; font-size: 0.84rem; text-transform: uppercase; letter-spacing: 0.06em; }

a { color: var(--accent); }

.badge {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.video { background: rgba(66, 186, 255, 0.15); border-color: rgba(66, 186, 255, 0.5); }
.badge.short { background: rgba(137, 108, 255, 0.18); border-color: rgba(137, 108, 255, 0.45); }
.badge.live { background: rgba(255, 72, 120, 0.18); border-color: rgba(255, 72, 120, 0.5); }
.badge.unknown { background: rgba(189, 202, 255, 0.12); border-color: rgba(189, 202, 255, 0.3); }

.messages { margin-bottom: 12px; }
.msg {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}
.msg.success { background: rgba(31, 168, 121, 0.17); border-color: rgba(31, 168, 121, 0.42); }
.msg.error { background: rgba(255, 91, 91, 0.14); border-color: rgba(255, 91, 91, 0.42); }

.log-box {
  margin-top: 12px;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid rgba(124, 165, 255, 0.28);
  border-radius: 12px;
  padding: 12px;
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #d6e0ff;
}

@media (max-width: 980px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: flex-start; }
}
