/* ==========================================================================
   Cutescape Studio — Product Gallery Staff Dashboard
   Palette: Cream, Mint-Green, and Soft Peach
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #F9F4EE;
  color: #2E2522;
  font: 15px/1.6 Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.staff-layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Header & Brand */
.staff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid #EADBCE;
  margin-bottom: 20px;
}

.staff-brand h1 {
  margin: 6px 0 0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  color: #2E2522;
}

.staff-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #D8F4E8;
  color: #16866F;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.staff-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.staff-nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: #FFFDF9;
  border: 1.5px solid #A8C5B5;
  color: #2E2522;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(46, 37, 34, 0.05);
  transition: all 0.15s ease;
}

.staff-nav-btn:hover {
  background: #D8F4E8;
  color: #16866F;
  transform: translateY(-1px);
}

/* Status Bar & Alert */
.staff-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.status-pill {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.status-verifying {
  background: #FFF8EE;
  color: #8A6D3B;
  border: 1px solid #F5E6CC;
}

.status-approved {
  background: #EDF5F0;
  color: #16866F;
  border: 1px solid #A8C5B5;
}

.status-error {
  background: #FDF0ED;
  color: #C0392B;
  border: 1px solid #F5B7B1;
}

.staff-alert {
  margin: 0 0 16px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  position: sticky;
  top: 12px;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.staff-alert:empty {
  display: none;
}

.staff-alert[data-error="false"] {
  background: #EDF5F0;
  color: #16866F;
  border: 1.5px solid #A8C5B5;
}

.staff-alert[data-error="true"] {
  background: #FDF0ED;
  color: #C0392B;
  border: 1.5px solid #F5B7B1;
}

.staff-progress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
  border: none;
}
.staff-progress::-webkit-progress-bar { background: #EADBCE; }
.staff-progress::-webkit-progress-value { background: #16866F; }

/* Dashboard Cards */
.staff-card {
  background: #FFFDF9;
  border: 1.5px solid #EADBCE;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(46, 37, 34, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #EADBCE;
  margin-bottom: 20px;
}

.card-title-group h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  color: #2E2522;
}

.card-desc {
  margin: 0;
  color: #7A6F68;
  font-size: 14px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #FFF8EE;
  color: #8A6D3B;
  border: 1px solid #EADBCE;
}

.status-badge[data-published="true"] {
  background: #EDF5F0;
  color: #16866F;
  border-color: #A8C5B5;
}

.link-external {
  color: #16866F;
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-external:hover {
  color: #0E5E4D;
}

/* Form Fields & Controls */
.fields-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.selectors-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bilingual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.lang-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-item label, .alt-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #4A3E39;
  margin-bottom: 6px;
}

.field-item .required {
  color: #C0392B;
}

input:not([type="file"]), select, textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #D5C6B7;
  border-radius: 10px;
  background: #FFFFFF;
  color: #2E2522;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:not([type="file"]):focus, select:focus, textarea:focus {
  border-color: #16866F;
  box-shadow: 0 0 0 3px rgba(22, 134, 111, 0.15);
  outline: none;
}

textarea {
  min-height: 85px;
  resize: vertical;
}

/* Upload Dropzone */
.upload-zone {
  margin: 20px 0;
}

.upload-label, .upload-cover-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  border: 2px dashed #A8C5B5;
  border-radius: 14px;
  background: #EDF5F0;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}

.upload-label:hover, .upload-cover-btn:hover {
  background: #D8F4E8;
  border-color: #16866F;
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.upload-text {
  font-size: 15px;
  color: #16866F;
}

.upload-hint {
  font-size: 12px;
  color: #7A6F68;
  margin-top: 4px;
}

.upload-zone input[type="file"], .upload-cover-btn input[type="file"] {
  display: none;
}

/* Photos List */
.photo-list-header {
  margin: 24px 0 12px;
}
.photo-list-header h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: #2E2522;
}
.photo-list-header .hint {
  margin: 0;
  font-size: 13px;
  color: #7A6F68;
}

#photoList {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#photoList li {
  background: #FFFFFF;
  border: 1px solid #EADBCE;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(46, 37, 34, 0.04);
}

.photo-edit {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.photo-edit img {
  width: 140px;
  height: 140px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #F7F1E7;
  border: 1px solid #EADBCE;
}

.photo-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-status-badge {
  font-size: 12px;
  font-weight: 600;
  color: #7A6F68;
}

.photo-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-reload {
  background: #FFFDF9;
  border: 1.5px solid #D5C6B7;
  color: #4A3E39;
  font-size: 13px;
  padding: 6px 14px;
}
.btn-reload:hover:not(:disabled) {
  background: #F7F1E7;
}

/* Workflow Actions */
.workflow-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 20px;
  border-top: 1.5px solid #EADBCE;
  margin-top: 24px;
}

.primary-workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-save {
  background: #16866F;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(22, 134, 111, 0.25);
}
.btn-save:hover:not(:disabled) {
  background: #0E5E4D;
  transform: translateY(-1px);
}

.btn-preview {
  background: #D8F4E8;
  color: #16866F;
  border: 1.5px solid #16866F;
}
.btn-preview:hover:not(:disabled) {
  background: #C2EBD9;
}

.btn-publish {
  background: #2E7D32;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
}
.btn-publish:hover:not(:disabled) {
  background: #236127;
  transform: translateY(-1px);
}

.btn-unpublish {
  background: #FFF8EE;
  color: #D35400;
  border: 1.5px solid #F5CBA7;
}
.btn-unpublish:hover:not(:disabled) {
  background: #FDF0ED;
  border-color: #F5B7B1;
}

/* Photo Edit Buttons */
.btn-photo {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #D5C6B7;
  background: #FFFDF9;
  color: #4A3E39;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.btn-photo:hover { background: #F7F1E7; }

.btn-replace {
  background: #EDF5F0;
  border-color: #A8C5B5;
  color: #16866F;
  position: relative;
  overflow: hidden;
}
.btn-replace input[type="file"] {
  display: none;
}
.btn-replace:hover { background: #D8F4E8; }

.btn-remove {
  background: #FDF0ED;
  border-color: #F5B7B1;
  color: #C0392B;
}
.btn-remove:hover {
  background: #FADBD8;
}

/* Canva Covers Section */
.cover-controls-grid {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.cover-preview-wrapper {
  margin: 16px 0;
  display: flex;
  justify-content: center;
  background: #F7F1E7;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #EADBCE;
}

.cover-preview-img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.cover-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn-remove-cover {
  background: #FDF0ED;
  color: #C0392B;
  border: 1.5px solid #F5B7B1;
}
.btn-remove-cover:hover:not(:disabled) {
  background: #FADBD8;
}

/* Asset List (Section C) */
.asset-cards-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.asset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #EADBCE;
  border-radius: 12px;
  padding: 12px 16px;
}

.asset-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #4A3E39;
}

.asset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-recover {
  background: #FFF8EE;
  color: #B7791F;
  border-color: #F6E05E;
}

.btn-assign {
  background: #EDF5F0;
  color: #16866F;
  border-color: #A8C5B5;
}

.btn-delete-asset {
  background: #FDF0ED;
  color: #C0392B;
  border-color: #F5B7B1;
}

.empty-asset-notice {
  padding: 16px;
  color: #7A6F68;
  font-style: italic;
  font-size: 13px;
}

/* Draft Preview Modal */
.staff-preview-dialog {
  width: min(92vw, 920px);
  max-height: 85vh;
  border: 0;
  border-radius: 18px;
  padding: 24px;
  background: #FFFDF9;
  color: #2E2522;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.staff-preview-dialog::backdrop {
  background: rgba(30, 22, 16, 0.85);
}

.dialog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.preview-tag {
  font-size: 13px;
  font-weight: 700;
  color: #D35400;
  background: #FFF8EE;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #F5CBA7;
}

.btn-close-preview {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #F7F1E7;
  color: #2E2522;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-close-preview:hover { background: #EADBCE; }

#previewTitle {
  margin: 8px 0 4px;
  font-size: 20px;
}
#previewDescription {
  margin: 0 0 18px;
  color: #7A6F68;
  font-size: 14px;
}

#previewGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#previewGrid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #F7F1E7;
  border: 1px solid #EADBCE;
}

@media (min-width: 768px) {
  #previewGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (min-width: 1024px) {
  #previewGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .staff-layout { padding: 16px 12px 40px; }
  .staff-card { padding: 18px; }
  .selectors-grid, .bilingual-grid, .cover-controls-grid {
    grid-template-columns: 1fr;
  }
  .photo-edit {
    grid-template-columns: 1fr;
  }
  .photo-edit img {
    width: 100%;
    max-height: 220px;
    height: auto;
  }
  .workflow-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .primary-workflow {
    flex-direction: column;
  }
  .primary-workflow .btn, .danger-workflow .btn {
    width: 100%;
  }
}
