:root {
  --bg-1: #050308;
  --bg-2: #12061f;
  --bg-3: #2a0f45;
  --bg-4: #09030e;
  --bg-5: #3a1559;
  --surface: rgba(15, 9, 26, 0.78);
  --surface-2: rgba(26, 12, 44, 0.78);
  --line: rgba(182, 108, 255, 0.45);
  --line-soft: rgba(137, 75, 197, 0.35);
  --text: #f6efff;
  --muted: #d8c8eb;
  --accent: #cb8cff;
  --accent-2: #ffe0b2;
}

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

body,
html {
  background: linear-gradient(
    135deg,
    var(--bg-1) 0%,
    var(--bg-2) 22%,
    var(--bg-3) 48%,
    var(--bg-4) 72%,
    var(--bg-5) 100%
  );
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  color: var(--text);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 9, 26, 0.86), rgba(26, 12, 44, 0.72));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

h1 {
  margin: 0 0 12px 0;
  line-height: 1.2;
  font-size: 2.3rem;
  letter-spacing: 0.01em;
  color: #ffffff;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: transparent;
  overflow: hidden;
}

th,
td {
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 1.08rem;
}

th {
  text-align: left;
  font-weight: 700;
  background: rgba(10, 6, 18, 0.9);
  color: #f9f5ff;
  letter-spacing: 0.02em;
}

tr:nth-child(even) {
  background: var(--surface-2);
}

tr:hover {
  background: rgba(58, 21, 89, 0.6);
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  color: #ffffff;
  text-decoration: underline;
}

td:first-child .file-link {
  word-break: break-word;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

td:first-child .file-link:hover {
  color: #ffffff;
}

.file-link {
  font: inherit;
}

button.file-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.video-link::before {
  content: "▶ ";
  color: var(--accent-2);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.download-link {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(34, 16, 52, 0.9);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.download-link.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-2);
}

.download-link:hover {
  background: rgba(58, 21, 89, 0.95);
}

.file-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 6, 18, 0.48);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 6, 18, 0.82);
}

.admin-bar strong {
  display: block;
  font-size: 1.05rem;
}

.admin-bar span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.password-field {
  display: grid;
  gap: 5px;
  min-width: 240px;
}

.password-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.password-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 3, 8, 0.9);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.password-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(203, 140, 255, 0.16);
}

.danger-btn {
  border: 1px solid rgba(255, 121, 121, 0.52);
  border-radius: 10px;
  background: rgba(130, 20, 35, 0.86);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-btn:hover {
  background: rgba(170, 28, 45, 0.94);
}

.select-col {
  width: 46px;
  text-align: center;
}

.select-col input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.flash {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

.flash.ok {
  border-color: rgba(69, 221, 132, 0.48);
  background: rgba(16, 92, 49, 0.52);
}

.flash.bad {
  border-color: rgba(255, 121, 121, 0.52);
  background: rgba(130, 20, 35, 0.52);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.modal-open {
  overflow: hidden;
}

.video-modal[hidden] {
  display: none;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
}

.video-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

.video-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 6, 18, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
  overflow: hidden;
}

.video-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.video-head h2 {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-download,
.video-close {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 11px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.video-close {
  background: rgba(130, 20, 35, 0.86);
  border-color: rgba(255, 121, 121, 0.52);
}

.video-dialog video {
  display: block;
  width: 100%;
  height: min(72vh, 720px);
  background: #000;
}

@media (max-width: 760px) {
  body,
  html {
    padding: 12px;
  }

  h1 {
    font-size: 2rem;
    margin-bottom: 12px;
  }

  .hero,
  .admin-bar {
    display: grid;
    align-items: stretch;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .password-field {
    min-width: 0;
  }

  .danger-btn {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table {
    border: 0;
    min-width: 0;
    background: transparent;
  }

  thead {
    display: none;
  }

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

  tr,
  tr:nth-child(even) {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 8px;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border: 0;
    padding: 8px 5px;
    font-size: 1.05rem;
  }

  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
  }

  td[data-label="File Name"] {
    display: block;
  }

  td.select-col,
  td[data-label="Delete"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  td[data-label="File Name"]::before {
    display: block;
    margin-bottom: 6px;
  }

  td[data-label="File Name"] .file-link {
    display: inline-block;
    line-height: 1.35;
    padding: 4px 0;
    font-size: 1.35rem;
  }

  .video-modal {
    padding: 10px;
  }

  .video-dialog {
    max-height: calc(100vh - 20px);
  }

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

  .video-dialog video {
    height: 62vh;
  }

  .download-link {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 12px 14px;
    font-size: 1.2rem;
  }
}
