@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Manrope:wght@400;500;600&display=swap");

:root {
  --bg: #090d14;
  --surface: rgba(18, 25, 37, 0.94);
  --surface-2: #1d2a3f;
  --border: #2d415e;
  --text: #e8eef8;
  --muted: #9baecc;
  --accent: #74e0bc;
  --accent-soft: rgba(116, 224, 188, 0.2);
  --danger: #ff7b91;
  --danger-soft: rgba(255, 123, 145, 0.12);
  --radius: 14px;
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at -10% 0%, rgba(53, 89, 132, 0.4), rgba(53, 89, 132, 0) 35%),
    radial-gradient(circle at 120% 90%, rgba(30, 103, 104, 0.35), rgba(30, 103, 104, 0) 38%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.5;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

.shape-a {
  width: 26rem;
  height: 26rem;
  top: -10rem;
  right: -8rem;
  background: #265f8a;
}

.shape-b {
  width: 20rem;
  height: 20rem;
  bottom: -10rem;
  left: -8rem;
  background: #20695e;
}

.page {
  width: min(1080px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.13em;
  font-size: 0.74rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.45rem;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 1.15;
}

h1 {
  margin-top: 0.2rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.home-link {
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  background: #172338;
  white-space: nowrap;
}

.home-link:hover {
  border-color: #4f7098;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.panel + .panel {
  margin-top: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.grid-form,
.upload-form {
  display: grid;
  gap: 0.72rem;
}

label {
  display: grid;
  gap: 0.3rem;
}

label span {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
textarea,
button {
  font-family: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f1727;
  color: var(--text);
  border-radius: 10px;
  padding: 0.62rem 0.7rem;
  outline: none;
}

input:focus-visible,
textarea:focus-visible {
  border-color: #96ffe5;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.inline-check input {
  width: 1rem;
  height: 1rem;
}

.inline-check span {
  color: var(--text);
}

.btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.56rem 0.75rem;
  color: var(--text);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, #28553f, #1e3d2f);
  border-color: #3c775a;
  font-weight: 600;
}

.btn-primary:hover {
  border-color: #61bc8f;
}

.btn-ghost {
  background: #182439;
}

.btn-ghost:hover {
  border-color: #4f7098;
}

.catalog-head {
  margin-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.hint {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.message {
  min-height: 1.2rem;
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.message.error {
  color: var(--danger);
}

.message.ok {
  color: var(--accent);
}

.videos-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.8rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.3rem 0;
}

.video-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  background: #111b2c;
}

.video-item > summary {
  list-style: none;
  cursor: pointer;
  margin: -0.8rem;
  padding: 0.8rem;
  border-radius: 12px;
}

.video-item > summary::-webkit-details-marker {
  display: none;
}

.video-item > summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.video-item[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.video-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.video-summary-left {
  display: grid;
  gap: 0.2rem;
}

.video-summary-left strong {
  font-size: 0.98rem;
}

.video-summary-sub {
  color: var(--muted);
  font-size: 0.8rem;
  word-break: break-word;
}

.video-summary-meta {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}

.tag {
  border: 1px solid #3c5578;
  border-radius: 999px;
  background: #18263d;
  color: #cfe1ff;
  font-size: 0.74rem;
  padding: 0.14rem 0.52rem;
  white-space: nowrap;
}

.tag-lock {
  border-color: #6e5a2d;
  background: #3a2f17;
  color: #ffe4a7;
}

.tag-expand {
  border-color: #3e6f5d;
  background: #173329;
  color: #bdffe6;
}

.video-body {
  margin-top: 0.68rem;
  padding-top: 0.68rem;
  border-top: 1px solid #263a57;
}

.video-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.video-top strong {
  font-size: 0.95rem;
}

.video-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.mini-btn {
  border: 1px solid #3d5475;
  background: #1b2a43;
  color: var(--text);
  border-radius: 8px;
  padding: 0.34rem 0.55rem;
  cursor: pointer;
}

.mini-btn:hover {
  border-color: #6b90bc;
}

.mini-btn.danger {
  border-color: #774255;
  background: var(--danger-soft);
}

.video-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-grid .full {
  grid-column: 1 / -1;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.check-field input {
  width: 1rem;
  height: 1rem;
}

.check-field span {
  color: var(--text);
  font-size: 0.9rem;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.logs-summary {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: #111d2f;
}

.metric .label {
  font-size: 0.78rem;
  color: var(--muted);
}

.metric .value {
  font-size: 1rem;
  font-weight: 700;
}

.table-wrap {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
  max-height: 340px;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.logs-table th,
.logs-table td {
  text-align: left;
  padding: 0.5rem 0.58rem;
  border-bottom: 1px solid #263a57;
  font-size: 0.83rem;
  vertical-align: top;
}

.logs-table th {
  position: sticky;
  top: 0;
  background: #1a2940;
  z-index: 1;
}

.logs-table td {
  color: #d8e4f8;
}

.logs-empty {
  color: var(--muted);
  text-align: center;
  padding: 0.8rem;
}

input:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
