:root {
  --bg: #0b1020;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(255, 255, 255, 0.12);
  --primary: #5b8cff;
  --orange: #ff8a00;
  --danger: #ff4d4d;
  --green: #21c277;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 20% 0%, rgba(91, 140, 255, 0.25), transparent 60%),
              radial-gradient(900px 600px at 80% 10%, rgba(255, 138, 0, 0.18), transparent 55%),
              var(--bg);
  color: var(--text);
}

.app { min-height: 100vh; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
}

.brand-tagline {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.row { display: flex; align-items: center; }
.space-between { justify-content: space-between; }
.gap { gap: 12px; }
.grow { flex: 1; }
.mt { margin-top: 12px; }
.mt-sm { margin-top: 8px; }
.mt-xs { margin-top: 6px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
}
.textarea { resize: vertical; }
.textarea-error { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(255,77,77,0.15); }

.btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: rgba(91,140,255,0.18); border-color: rgba(91,140,255,0.35); }
.btn-orange { background: rgba(255,138,0,0.18); border-color: rgba(255,138,0,0.35); }
.btn-secondary { background: rgba(255,255,255,0.06); }
.btn-danger { background: rgba(255,77,77,0.14); border-color: rgba(255,77,77,0.35); }

.error-detail {
  font-size: 11px;
  color: var(--danger);
  word-break: break-word;
  max-width: 36rem;
  line-height: 1.35;
}

.error-banner {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
}
.error-banner-title { font-weight: 700; margin-bottom: 4px; }
.error-banner-body { font-size: 13px; line-height: 1.4; word-break: break-word; }
.error-banner-red {
  border-color: rgba(255,77,77,0.45);
  background: rgba(255,77,77,0.10);
  color: #ffb3b3;
}
.error-banner-amber {
  border-color: rgba(255,176,32,0.55);
  background: rgba(255,176,32,0.12);
  color: #ffd089;
}

.muted { color: var(--muted); font-size: 13px; }
.link { color: var(--text); text-decoration: none; opacity: 0.92; }
.link:hover { opacity: 1; text-decoration: underline; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.2);
}
.list-item-editing {
  align-items: stretch;
  flex-direction: column;
  background: rgba(255,255,255,0.03);
}
.item-title { font-weight: 700; }
.item-actions { display: flex; gap: 8px; align-items: center; }

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  color: var(--text);
}
.badge-red { border-color: rgba(255,77,77,0.4); background: rgba(255,77,77,0.14); }
.badge-green { border-color: rgba(33,194,119,0.4); background: rgba(33,194,119,0.14); }
.badge-amber { border-color: rgba(255,176,32,0.5); background: rgba(255,176,32,0.16); color: #ffd089; }
.badge-blue-solid {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #FFFFFF;
  font-weight: 600;
}
.badge-orange-solid {
  background: #EA580C;
  border-color: #EA580C;
  color: #FFFFFF;
  font-weight: 600;
}

.row-type-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.row-type-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.row-type-option input { accent-color: #1D4ED8; }

.empty {
  text-align: center;
  padding: 26px 16px;
}
.empty-title { font-weight: 800; font-size: 18px; margin-bottom: 12px; }
.hidden { display: none; }

.thumb {
  width: 80px;
  height: 45px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  flex: 0 0 auto;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.table { width: 100%; }
.table-head, .table-row {
  display: grid;
  grid-template-columns: 100px 1.4fr 0.6fr 0.4fr 0.9fr;
  gap: 10px;
  align-items: center;
}
.audio-review-table .table-head,
.audio-review-table .table-row:not(.table-row-editing) {
  grid-template-columns: 100px 0.9fr 1.4fr 0.6fr 0.4fr 0.9fr;
}
.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #FFFFFF;
  background: linear-gradient(135deg, #EA580C, #F97316);
}
.table-head {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}
.table-row {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}
.table-row-editing {
  display: block;
  padding: 14px 12px;
  background: rgba(255,255,255,0.03);
}

.actions-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.actions-stack .btn { padding: 6px 10px; font-size: 12px; }

.edit-panel {
  display: block;
}
.edit-panel-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

audio { width: 100%; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .table-head, .table-row { grid-template-columns: 90px 1fr; }
  .table-row-editing { display: block; }
}

