.bgd-director-page {
  max-width: 1400px;
  margin: 20px auto;
  padding: 10px 20px 40px;
  color: #e5e7eb;
  background: #0b111e;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.bgd-header-bar {
  background: linear-gradient(90deg, #1a2d4a, #101a2e);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.45);
}

.bgd-title {
  font-size: 22px;
  font-weight: 700;
  color: #c6a667;
}

.bgd-subtitle {
  color: #9ca3af;
  margin-top: 2px;
}

.bgd-header-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bgd-pill {
  background: #101a2e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  padding: 8px 12px;
  border-radius: 12px;
  color: #e5e7eb;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.15);
}

.bgd-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.bgd-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bgd-grid-panels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bgd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.bgd-layout-main {
  min-width: 0;
}

.bgd-layout-side {
  min-width: 0;
}

.bgd-instruction-panel {
  position: sticky;
  top: 16px;
}

.bgd-instruction-body {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.6;
}

.bgd-instruction-body ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.bgd-video-embed {
  margin-top: 12px;
}

.bgd-video-embed__inner {
  position: relative;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: #0b111e;
}

.bgd-video-embed__inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.bgad-dir-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.bgad-dir-card {
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 10px;
  padding: 12px;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bgad-dir-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.bgad-dir-card-head span {
  font-size: 12px;
  color: #9ca3af;
}

.bgad-dir-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bgd-grid-library {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.bgd-grid-clips {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.bgd-card {
  background: #101a2e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.45);
}

.bgd-card-compact {
  padding: 12px;
}

.bgd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.bgd-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #e5e7eb;
}

.bgd-section-title.small {
  font-size: 14px;
  margin-top: 10px;
}

.bgd-label {
  display: inline-block;
  margin: 8px 0 4px;
  color: #9ca3af;
}

.bgd-input,
.bgd-textarea {
  width: 100%;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: #e5e7eb;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.15);
}

.bgd-textarea {
  resize: vertical;
}

.bgd-input:focus,
.bgd-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.bgd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: #1a2d4a;
  color: #e5e7eb;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bgd-button:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.bgd-button-primary {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  border-color: rgba(37, 99, 235, 0.6);
  color: #fff;
}

.bgd-button-danger {
  background: #2b1113;
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
}

.bgd-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bgd-upload-zone {
  border: 2px dashed rgba(37, 99, 235, 0.35);
  background: rgba(26, 45, 74, 0.4);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  text-align: center;
  transition: all 0.15s ease;
}

.bgd-upload-zone.dragover {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 0 25px rgba(37, 99, 235, 0.45);
}

.bgd-upload-zone__text {
  margin-bottom: 8px;
  color: #9ca3af;
}

.bgd-upload-selected {
  margin-top: 6px;
  color: #e5e7eb;
}

.bgd-upload-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bgd-upload-summary {
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  padding: 10px;
  color: #e5e7eb;
}
.bgd-upload-summary .bgd-upload-meta {
  color: #9ca3af;
  font-size: 12px;
  margin-top: 4px;
}
.bgd-upload-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bgd-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bgd-upload-status {
  color: #9ca3af;
  font-size: 12px;
}

.bgd-library-cards .bgd-library-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background: #101a2e;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
}
.bgd-library-cards .bgd-library-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.25);
}
.bgd-library-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #0b111e;
  display: block;
}
.bgd-library-thumb.missing {
  filter: grayscale(0.6);
  opacity: 0.5;
}
.bgd-library-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bgd-library-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9ca3af;
  font-size: 12px;
}
.bgd-library-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bgd-library-desc {
  color: #9ca3af;
  font-size: 12px;
  max-height: 40px;
  overflow: hidden;
}
.bgd-fade-in {
  animation: bgd-fade-in 180ms ease;
}
@keyframes bgd-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.bgd-progress {
  margin: 10px 0;
}

.bgd-progress-bar {
  width: 100%;
  height: 10px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.15);
}

.bgd-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  transition: width 0.2s ease;
}

.bgd-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  color: #9ca3af;
}

.bgd-error-bar {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.bgd-log {
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  min-height: 120px;
  max-height: 210px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 8px;
  font-family: "SFMono-Regular", monospace;
  color: #9ca3af;
}

.bgd-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.bgd-clip-card {
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.15);
}

.bgd-clip-thumb {
  background: #1a2d4a;
  border-radius: 8px;
  height: 140px;
}

.bgd-clip-meta {
  color: #e5e7eb;
  display: grid;
  gap: 4px;
}

.bgd-muted {
  color: #9ca3af;
  font-size: 12px;
}

.bgd-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bgd-form-grid input[type="range"] {
  width: 100%;
}

.bgd-input-meta {
  text-align: right;
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 8px;
}

.bgd-subsection {
  margin-top: 14px;
}

.bgd-empty {
  color: #9ca3af;
  text-align: center;
  padding: 12px;
}

.bgd-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
}

.bgd-modal {
  max-width: 720px;
  width: 90%;
  background: #101a2e;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.45);
}

.bgd-modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bgd-modal video {
  width: 100%;
  border-radius: 10px;
  background: #000;
}

.bgd-button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.bgd-hidden {
  display: none !important;
}

/* Progress Components */
.bgd-upload-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bgd-progress-bar-line {
  position: relative;
  width: 100%;
  height: 10px;
  background: #0b111e;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.2);
}
.bgd-progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #1d4ed8, #2563eb);
  background-size: 200% 100%;
  animation: bgd-progress-stripe 2s linear infinite;
}
@keyframes bgd-progress-stripe {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}
.bgd-progress-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
}

.bgd-task-status {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}
.bgd-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(37, 99, 235, 0.35);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: bgd-spin 0.9s linear infinite;
}
@keyframes bgd-spin {
  to {
    transform: rotate(360deg);
  }
}
.bgd-task-text {
  color: #e5e7eb;
  font-weight: 600;
}
.bgd-task-time {
  grid-column: 2 / span 1;
  color: #9ca3af;
  font-size: 12px;
}

.bgd-speed-gauge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(16, 26, 46, 0.8);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.bgd-speed-gauge[data-tone="green"] {
  color: #48d1a0;
  border-color: rgba(72, 209, 160, 0.4);
}
.bgd-speed-gauge[data-tone="yellow"] {
  color: #f1c232;
  border-color: rgba(241, 194, 50, 0.4);
}
.bgd-speed-gauge[data-tone="red"] {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

@media (max-width: 1024px) {
  .bgd-grid-two {
    grid-template-columns: 1fr;
  }
  .bgd-layout {
    grid-template-columns: 1fr;
  }
  .bgd-instruction-panel {
    position: static;
  }
  .bgd-grid-panels {
    grid-template-columns: 1fr;
  }
  .bgd-grid-clips {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .bgd-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .bgd-stat-row {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* Prevent all Director modals from ever showing by default */
.bg-modal,
.bg-modal-backdrop {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Active modals */
.bg-modal.active,
.bg-modal-backdrop.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}