/* =========================================================
   BACKGROUND 4K - MANAGEMENT / ADMIN
========================================================= */

.management-view {
  position: fixed;
  inset: 0;
  z-index: 200;

  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);

  background: #07101f;
}


/* =========================================================
   SIDEBAR
========================================================= */

.management-sidebar {
  min-width: 0;
  overflow-y: auto;

  padding: 24px 16px;

  background: #091426;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.management-sidebar h2 {
  margin: 0 8px 25px;

  font-size: 24px;
}

.management-sidebar > button {
  width: 100%;
  min-height: 44px;

  margin-bottom: 7px;
  padding: 10px 13px;

  border-radius: 9px;

  background: transparent;
  color: #aebbd0;

  text-align: left;
  font-weight: 600;
}

.management-sidebar > button:hover,
.management-sidebar > button.active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

#close-management {
  margin-top: 25px;
}


/* =========================================================
   CONTENT
========================================================= */

.management-content {
  min-width: 0;
  overflow-y: auto;

  padding: 35px;
}

.management-page {
  width: min(100%, 1400px);
  margin: 0 auto;
}

.management-page > h2 {
  margin: 0 0 27px;

  font-size: 32px;
}


/* =========================================================
   TOOLBAR
========================================================= */

.management-toolbar,
.upload-toolbar,
.trash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;

  margin-bottom: 20px;
}

.management-toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}


/* =========================================================
   TABLE / LIST
========================================================= */

.management-table-wrapper {
  width: 100%;
  overflow-x: auto;

  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;

  background: rgba(16, 29, 50, 0.8);
}

.management-table {
  width: 100%;
  min-width: 850px;

  border-collapse: collapse;
}

.management-table th,
.management-table td {
  padding: 13px 14px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.07);

  text-align: left;
  vertical-align: middle;
}

.management-table th {
  color: #aebbd0;

  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.management-table td {
  color: #e8edf6;
  font-size: 14px;
}

.management-table tr:last-child td {
  border-bottom: 0;
}

.management-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.management-thumbnail {
  width: 96px;
  aspect-ratio: 16 / 9;

  object-fit: cover;

  border-radius: 7px;

  background: #050b15;
}


/* =========================================================
   STATUS BADGES
========================================================= */

.status-badge {
  display: inline-flex;
  align-items: center;

  min-height: 26px;
  padding: 3px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;
}

.status-active,
.status-completed {
  background: rgba(69, 181, 108, 0.13);
  color: #9ce5b5;
}

.status-processing,
.status-pending {
  background: rgba(226, 179, 67, 0.13);
  color: #ebce82;
}

.status-failed,
.status-blocked,
.status-locked {
  background: rgba(239, 93, 104, 0.13);
  color: #ff939b;
}

.status-disabled,
.status-trashed {
  background: rgba(154, 166, 186, 0.12);
  color: #aeb9c9;
}


/* =========================================================
   UPLOAD DROP ZONE
========================================================= */

.upload-drop-zone {
  min-height: 330px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;

  padding: 35px;

  border: 2px dashed rgba(124, 140, 255, 0.36);
  border-radius: 20px;

  background:
    radial-gradient(
      circle at center,
      rgba(124, 140, 255, 0.08),
      transparent 55%
    ),
    rgba(16, 29, 50, 0.62);

  text-align: center;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.upload-drop-zone.dragging {
  border-color: #8f9cff;

  background:
    rgba(124, 140, 255, 0.12);
}

.upload-drop-zone p {
  margin: 0;

  color: #c1cbda;
  font-size: 18px;
  font-weight: 700;
}

.upload-drop-zone > div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}


/* =========================================================
   UPLOAD REVIEW
========================================================= */

.upload-step {
  width: 100%;
}

#upload-review-list,
#upload-progress-list {
  display: grid;
  gap: 12px;
}

.upload-review-item {
  display: grid;

  grid-template-columns:
    150px minmax(180px, 1fr) minmax(220px, 1fr) auto;

  align-items: center;
  gap: 15px;

  padding: 13px;

  background: rgba(16, 29, 50, 0.82);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
}

.upload-review-preview {
  width: 150px;
  aspect-ratio: 16 / 9;

  object-fit: cover;

  border-radius: 8px;

  background: #050b15;
}

.upload-review-info {
  min-width: 0;
}

.upload-review-filename {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  color: #8f9db2;
  font-size: 12px;
}

.upload-review-name {
  margin: 5px 0;

  font-weight: 700;
}

.upload-item-error {
  color: #ff939b;
  font-size: 12px;
}

.upload-item-warning {
  color: #e8c778;
  font-size: 12px;
}

.upload-item-success {
  color: #9ce5b5;
  font-size: 12px;
}


/* =========================================================
   CATEGORY CHECKBOX LIST
========================================================= */

.category-checkbox-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fill, minmax(150px, 1fr));

  gap: 8px;
}

.category-checkbox-item {
  display: flex;
  align-items: center;
  gap: 7px;

  margin: 0;
  padding: 8px 10px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.035);
}

.category-checkbox-item input {
  width: 17px;
  height: 17px;
  min-height: 17px;
}


/* =========================================================
   TAG EDITOR
========================================================= */

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;

  padding: 8px;

  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;

  background: rgba(3, 10, 20, 0.55);
}

.tag-editor-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 8px;

  border-radius: 999px;

  background: rgba(124, 140, 255, 0.13);
  color: #c4cbff;

  font-size: 12px;
}

.tag-editor-tag button {
  padding: 0;

  background: transparent;
  color: #c4cbff;
}


/* =========================================================
   UPLOAD SUMMARY / PROGRESS
========================================================= */

.upload-summary-card {
  margin-bottom: 20px;
  padding: 18px;

  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;

  background: rgba(16, 29, 50, 0.82);
}

.upload-summary-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(150px, 1fr));

  gap: 12px;
}

.upload-summary-value {
  font-size: 25px;
  font-weight: 800;
}

.upload-summary-label {
  color: #8f9db2;
  font-size: 12px;
}

.upload-progress-item {
  padding: 13px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;

  background: rgba(16, 29, 50, 0.72);
}

.upload-progress-bar {
  height: 7px;
  margin-top: 9px;

  overflow: hidden;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);
}

.upload-progress-bar > div {
  width: 0;
  height: 100%;

  border-radius: inherit;

  background: #7c8cff;

  transition: width 0.2s ease;
}


/* =========================================================
   TRASH
========================================================= */

.trash-item {
  display: grid;

  grid-template-columns:
    auto 110px minmax(180px, 1fr) auto;

  align-items: center;
  gap: 14px;

  margin-bottom: 10px;
  padding: 13px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;

  background: rgba(16, 29, 50, 0.78);
}

.trash-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.trash-thumbnail {
  width: 110px;
  aspect-ratio: 16 / 9;

  object-fit: cover;

  border-radius: 7px;
}

.trash-meta {
  color: #8f9db2;
  font-size: 12px;
}


/* =========================================================
   USER MANAGEMENT
========================================================= */

.role-badge {
  display: inline-flex;

  padding: 4px 9px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;
}

.role-admin {
  background: rgba(219, 172, 64, 0.14);
  color: #f0d27d;
}

.role-manager {
  background: rgba(124, 140, 255, 0.14);
  color: #bdc5ff;
}

.role-member {
  background: rgba(75, 178, 126, 0.13);
  color: #a5e5c0;
}

.role-guest {
  background: rgba(157, 169, 187, 0.12);
  color: #bdc5d1;
}


/* =========================================================
   AUDIT LOG
========================================================= */

.audit-item {
  padding: 14px 16px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.audit-item:last-child {
  border-bottom: 0;
}

.audit-action {
  color: #fff;
  font-weight: 700;
}

.audit-meta {
  margin-top: 4px;

  color: #8997ac;
  font-size: 12px;
}


/* =========================================================
   SETTINGS
========================================================= */

#management-website {
  display: grid;
  gap: 20px;
}

#management-website > h2 {
  margin-bottom: 7px;
}

.settings-card {
  display: grid;
  gap: 12px;
}

.settings-card h3 {
  margin: 0 0 7px;

  font-size: 20px;
}

.settings-card select {
  max-width: 330px;
}

.settings-card > .primary-button {
  width: fit-content;
}

#current-hero-preview {
  min-height: 190px;

  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;

  background:
    radial-gradient(
      circle at center,
      #263958,
      #0a1424
    );
}

#hero-history-list {
  display: grid;

  grid-template-columns:
    repeat(auto-fill, minmax(210px, 1fr));

  gap: 12px;

  margin-top: 8px;
}

.hero-history-item {
  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;

  background: rgba(255, 255, 255, 0.035);
}

.hero-history-item img {
  width: 100%;
  aspect-ratio: 16 / 6;

  object-fit: cover;
}

.hero-history-actions {
  padding: 10px;
}


/* =========================================================
   EMPTY MANAGEMENT STATE
========================================================= */

.management-empty {
  padding: 50px 20px;

  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 14px;

  color: #8997ac;
  text-align: center;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {
  .management-view {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .management-content {
    padding: 25px 20px;
  }

  .upload-review-item {
    grid-template-columns:
      120px minmax(0, 1fr);
  }

  .upload-review-preview {
    width: 120px;
  }
}


@media (max-width: 700px) {
  .management-view {
    position: fixed;

    display: block;

    overflow-y: auto;
  }

  .management-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;

    display: flex;
    gap: 6px;

    overflow-x: auto;

    padding: 10px;

    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  }

  .management-sidebar h2 {
    display: none;
  }

  .management-sidebar > button {
    width: auto;
    min-width: max-content;

    margin: 0;
  }

  #close-management {
    margin-top: 0;
  }

  .management-content {
    overflow: visible;

    padding: 22px 12px 60px;
  }

  .management-page > h2 {
    font-size: 26px;
  }

  .upload-drop-zone {
    min-height: 250px;

    padding: 25px 14px;
  }

  .upload-review-item {
    display: block;
  }

  .upload-review-preview {
    width: 100%;

    margin-bottom: 12px;
  }

  .trash-item {
    grid-template-columns:
      auto 90px minmax(0, 1fr);
  }

  .trash-thumbnail {
    width: 90px;
  }

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