:root {
  --bg: #0c111a;
  --surface: #111826;
  --surface-2: #172234;
  --text: #eef3ff;
  --muted: #9fb0cc;
  --accent: #2fb5ff;
  --danger: #ff5f5f;
  --ok: #53d39a;
  --warn: #f1c25d;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 0%, #192740 0%, var(--bg) 45%);
  color: var(--text);
}

.container {
  width: min(1200px, 92vw);
  margin: 24px auto 48px;
}

.card {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid #24354f;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

h1,
h2,
h3 {
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

h2 {
  font-size: 1.05rem;
  color: #d8e7ff;
}

p,
label,
small {
  color: var(--muted);
}

input,
select,
button,
textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #2c3f5f;
  background: #0f1727;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

button {
  cursor: pointer;
  background: linear-gradient(180deg, #2f8fff, #2d74de);
  border: none;
  font-weight: 700;
}

button.secondary,
.button-link.secondary {
  background: #1a263a;
  border: 1px solid #304868;
}

button.danger {
  background: #732f33;
}

form {
  display: grid;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid #253854;
  text-align: left;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.queued {
  background: #6a550f;
  color: #fbe58e;
}

.badge.rendering {
  background: #114a79;
  color: #92d3ff;
}

.badge.completed {
  background: #0f5b3d;
  color: #95f3c6;
}

.badge.failed,
.badge.expired {
  background: #6a2323;
  color: #ffb4b4;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button,
.row-actions a {
  width: auto;
  padding: 6px 10px;
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 8px;
}

a {
  color: #8dbfff;
}

#flash {
  min-height: 1.2rem;
}

#flash.error {
  color: #ffb6b6;
}

#flash.success {
  color: #9de8c4;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat {
  background: #0d1627;
  border: 1px solid #24344f;
  border-radius: 8px;
  padding: 10px;
}

.stat strong {
  display: block;
  font-size: 1.15rem;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(420px, 100%);
}

.video-wrap {
  display: grid;
  gap: 14px;
}

video {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #2a3f5f;
  background: #010203;
}

.inline {
  display: flex;
  gap: 10px;
}

.inline > * {
  flex: 1;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions button,
.header-actions .button-link {
  width: auto;
}

.button-link {
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 760px) {
  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
