/* Import common variables and base styles */
@import url('/static/common.css');

/* ============== Login Screen ============== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}
.login-logo {
  font-size: 64px;
  text-align: center;
  margin-bottom: 16px;
}
.login-card {
  background: white;
  padding: 48px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--gray-200);
}
.login-card h2 {
  color: var(--gray-900);
  margin: 0 0 8px 0;
  text-align: center;
  font-weight: 700;
  font-size: 28px;
}
.login-subtitle {
  color: var(--gray-500);
  text-align: center;
  margin: 0 0 32px 0;
  font-size: 14px;
}
.login-input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 2px solid var(--gray-300);
  transition: var(--transition);
  font-size: 15px;
  font-family: inherit;
  background: var(--gray-50);
}
.login-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
  background: white;
}
.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(51, 65, 85, 0.3);
}
.login-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: none;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #fca5a5;
}

/* ============== Header ============== */
.designer-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2);
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-title h1,
.designer-header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
  font-size: 13px;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.header-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.header-btn.stats {
  background: rgba(147, 51, 234, 0.3);
  border-color: rgba(147, 51, 234, 0.5);
}
.header-btn.stats:hover {
  background: rgba(147, 51, 234, 0.45);
}
.header-btn.refresh {
  background: rgba(8, 145, 178, 0.3);
  border-color: rgba(8, 145, 178, 0.5);
}
.header-btn.refresh:hover {
  background: rgba(8, 145, 178, 0.45);
}
.header-btn.logout {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}
.header-btn.logout:hover {
  background: rgba(239, 68, 68, 0.25);
}
.header-btn.bulk-download {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
}
.header-btn.bulk-download:hover {
  background: rgba(16, 185, 129, 0.45);
}
.header-btn.bulk-upload {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.5);
}
.header-btn.bulk-upload:hover {
  background: rgba(139, 92, 246, 0.45);
}
.header-separator {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
}
.header-user {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}
.header-earnings {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.4));
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-earnings .amount {
  color: #a7f3d0;
}

/* Category Dropdown */
.header-category select {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.header-category select:hover {
  background: rgba(255, 255, 255, 0.25);
}
.header-category select option {
  background: var(--gray-800);
  color: white;
}

/* Designer Filter */
.header-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.header-filter label {
  font-weight: 500;
  opacity: 0.9;
}
.header-filter select {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.header-filter select option {
  background: #1e293b;
  color: white;
}

/* ============== Designer Body: Sidebar + Detail ============== */
.designer-body {
  display: flex;
  height: calc(100vh - 56px); /* subtract header height */
  overflow: hidden;
}

/* ============== Sidebar ============== */
.sidebar {
  width: 340px;
  min-width: 340px;
  background: white;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 0;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.sidebar-filters {
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-filters .filter-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar-filters .filter-select {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.sidebar-filters .filter-select label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-filters .filter-select select,
.sidebar-filters .filter-select input[type='date'] {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: white;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.sidebar-filters .filter-select select:hover,
.sidebar-filters .filter-select input[type='date']:hover {
  border-color: var(--accent);
}

.sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: white;
}

.sidebar-toolbar .task-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
}

.sidebar-toolbar-actions {
  display: flex;
  gap: 6px;
}

.sidebar-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-btn:hover:not(:disabled) {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

.sidebar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-btn.download-selected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.15));
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
}

.sidebar-btn.download-selected:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.25));
}

/* Sidebar List */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--gray-500);
  gap: 12px;
}

.sidebar-loading .loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sidebar-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

/* Sidebar Item */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--gray-100);
  transition: all 0.15s;
  cursor: default;
}

.sidebar-item:hover {
  background: linear-gradient(90deg, var(--gray-50) 0%, white 100%);
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.1) 0%, rgba(8, 145, 178, 0.03) 100%);
  border-left: 3px solid var(--accent);
}

.sidebar-item.active .sidebar-item-sku {
  color: var(--accent-dark);
}

.sidebar-item-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px 0 12px;
  flex-shrink: 0;
}

.sidebar-item-checkbox .instance-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.sidebar-item-content {
  flex: 1;
  padding: 10px 12px 10px 4px;
  cursor: pointer;
  min-width: 0;
}

.sidebar-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.sidebar-item-sku {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item-status {
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-item-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.sidebar-item-difficulty {
  font-weight: 700;
  text-transform: capitalize;
}

.sidebar-item-price {
  color: var(--success);
  font-weight: 600;
}

.sidebar-item-steps {
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}

/* ============== Detail Panel ============== */
.detail-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-secondary);
  min-width: 0;
}

.detail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-400);
  text-align: center;
  padding: 40px;
}

.detail-placeholder-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.detail-placeholder h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--gray-500);
}

.detail-placeholder p {
  margin: 0;
  font-size: 14px;
}

/* Detail Content */
.detail-content {
  padding: 16px 20px;
}

/* ─── Status Bar ─── */
.detail-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.detail-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-status-icon {
  font-size: 20px;
}

.detail-status-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-800);
}

.detail-status-note {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 400;
}

.detail-status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-time {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ─── Info Cards Grid ─── */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.detail-info-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}

.detail-info-card:hover {
  box-shadow: var(--shadow);
}

.detail-info-card.detail-info-sku {
  border-top: none;
}

.detail-info-card.detail-info-project {
  border-top: none;
}

.detail-info-card.detail-info-difficulty {
  border-top: none;
}

.detail-info-card.detail-info-meta {
  border-top: none;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.info-card-icon {
  font-size: 14px;
}

.info-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
  word-break: break-all;
}

.info-card-value.mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 15px;
  color: var(--accent-dark);
}

.info-card-sub {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
  font-weight: 500;
}

.info-card-meta-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-card-meta-list span {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  color: var(--gray-300);
  transition: var(--transition);
  border-radius: 4px;
  margin-left: auto;
}
.copy-btn:hover {
  background: var(--gray-100);
  color: var(--accent);
}

/* ─── Step Navigation ─── */
.detail-step-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

.step-nav-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  background: var(--gray-200);
  color: var(--gray-600);
}

.step-dot.completed {
  background: var(--success-light);
  color: white;
}

.step-dot.rejected {
  background: var(--danger-light);
  color: white;
}

.step-dot.pending {
  background: #fbbf24;
  color: white;
}

.step-dot.active {
  border-color: var(--primary-dark);
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.step-dot:hover {
  transform: scale(1.1);
}

.edition-count {
  background: var(--accent);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* ─── Edition Layout: Two Columns ─── */
.detail-edition {
  margin-bottom: 16px;
}

.edition-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.edition-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edition-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Edition Header ─── */
.detail-edition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edition-step-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: 6px;
}

.edition-date {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ─── Alert Boxes ─── */
.detail-alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  align-items: flex-start;
}

.detail-alert-error {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #fca5a5;
}

.detail-alert-info {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #93c5fd;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.alert-content p {
  font-size: 12px;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
}

.alert-detail {
  margin-top: 6px !important;
  font-family: monospace;
  font-size: 11px !important;
  color: #991b1b !important;
  background: rgba(255, 255, 255, 0.5);
  padding: 6px 8px;
  border-radius: 4px;
}

/* ─── Image Container ─── */
.detail-image-container {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--gray-800);
  box-shadow: var(--shadow-md);
}

.detail-image-container--compact {
  max-height: 380px;
}

.detail-image {
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  cursor: pointer;
  transition: var(--transition);
  display: block;
}

.detail-image:hover {
  opacity: 0.95;
}

.detail-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.image-zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.detail-image-container:hover .image-zoom-hint {
  opacity: 1;
}

/* ─── Instructions Card ─── */
.detail-instructions-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  border-left: 3px solid #f59e0b;
}

.detail-instructions-card.empty {
  border-left-color: var(--gray-300);
}

.instructions-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.instructions-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin: 0;
}

.detail-comments {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.7;
  margin: 0 0 8px 0;
}

.detail-comments.muted {
  color: var(--gray-400);
  font-style: italic;
}

.bbox-list {
  margin: 8px 0 0 0;
  padding: 0;
  list-style: none;
}

.bbox-list li {
  padding: 4px 0;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-600);
  line-height: 1.4;
}

.bbox-num {
  background: #ef4444;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Action Buttons ─── */
.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  border: none;
  width: 100%;
}

.btn-download-action {
  background: white;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.btn-download-action:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow);
}

.btn-submit-action {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}
.btn-submit-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.btn-reject-action {
  background: white;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.btn-reject-action:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.form-buttons {
  display: flex;
  gap: 8px;
}
.form-buttons .btn-action {
  flex: 1;
}

/* ─── Upload Card ─── */
.upload-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  border-left: 3px solid var(--success);
}

.upload-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.upload-card-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin: 0;
}

.upload-form-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-input-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}

.file-input-area:hover {
  border-color: var(--accent);
  background: rgba(8, 145, 178, 0.03);
}

.file-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.file-drop-icon {
  font-size: 28px;
}

.file-drop-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.file-name {
  font-size: 11px;
  color: var(--gray-400);
}

.file-name.has-file {
  color: var(--success);
  font-weight: 500;
}

/* ─── Reference Images ─── */
.detail-ref-images {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  border-left: 3px solid #8b5cf6;
}

.ref-images-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ref-images-header h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin: 0;
}

.ref-images-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ref-thumbnail {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  border: 2px solid transparent;
}

.ref-thumbnail:hover {
  transform: scale(1.05);
  border-color: #8b5cf6;
}

.ref-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ref-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(139, 92, 246, 0.85);
  color: white;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
}

/* ─── Compact Detail Header ─── */
.detail-header {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-200);
}
.detail-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.detail-sku {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.copy-sku-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
  opacity: 0.35;
  transition: opacity 0.15s;
}
.copy-sku-btn:hover {
  opacity: 1;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-pill--pending {
  background: #fef3c7;
  color: #92400e;
}
.status-pill--sent {
  background: #dbeafe;
  color: #1e40af;
}
.status-pill--rejected {
  background: #fee2e2;
  color: #991b1b;
}
.status-pill--approved {
  background: #d1fae5;
  color: #065f46;
}
.detail-header-spacer {
  flex: 1;
}
.detail-time-label {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 500;
}
.detail-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.meta-item {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}
.meta-detail {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
}
.meta-sep {
  font-size: 10px;
  color: var(--gray-300);
}
.meta-divider {
  width: 1px;
  height: 14px;
  background: var(--gray-200);
  margin: 0 4px;
}
.difficulty-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 8px;
  text-transform: uppercase;
}
.difficulty-pill--easy {
  background: #d1fae5;
  color: #065f46;
}
.difficulty-pill--medium {
  background: #fef3c7;
  color: #92400e;
}
.difficulty-pill--hard {
  background: #fee2e2;
  color: #991b1b;
}
.meta-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

/* ─── Edition Header Row ─── */
.edition-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.edition-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
}
.edition-time {
  font-size: 11px;
  color: var(--gray-400);
}

/* ─── Edition Alerts (compact) ─── */
.edition-alert {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
}
.edition-alert strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}
.edition-alert p {
  margin: 0;
  opacity: 0.85;
}
.edition-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}
.edition-alert--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}
.edition-alert-trace {
  margin: 6px 0 0;
  font-family: monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.04);
  padding: 4px 6px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── Edition Sections ─── */
.edition-section {
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}
.section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.edition-comments {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.6;
  margin: 0 0 4px 0;
}
.edition-comments--muted {
  color: var(--gray-400);
  font-style: italic;
}

/* ─── Compact Buttons ─── */
.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  border: none;
}
.btn-compact--secondary {
  background: white;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.btn-compact--secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.btn-compact--success {
  background: var(--success);
  color: white;
  flex: 1;
}
.btn-compact--success:hover {
  background: var(--success-light);
}
.btn-compact--danger {
  background: white;
  color: #dc2626;
  border: 1px solid #fca5a5;
  flex: 1;
}
.btn-compact--danger:hover {
  background: #fef2f2;
}

/* ─── Upload Form ─── */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--gray-50);
  transition: var(--transition);
  font-size: 12px;
  color: var(--gray-500);
}
.file-input-label:hover {
  border-color: var(--accent);
  background: rgba(8, 145, 178, 0.03);
}
.file-input-label input[type='file'] {
  display: none;
}
.file-input-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.file-input-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-input-text.has-file {
  color: var(--success);
  font-weight: 600;
}
.upload-actions {
  display: flex;
  gap: 6px;
}

/* ─── Reference Images (compact) ─── */
.ref-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ref-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  transition: var(--transition);
}
.ref-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}
.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============== Status Badges ============== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-pending {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
}
.status-completed,
.status-sent {
  background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
  color: #1e40af;
}
.status-failed,
.status-rejected {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

/* ============== Difficulty Badges ============== */
.difficulty-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.difficulty-easy {
  background: #d1fae5;
  color: #065f46;
}
.difficulty-medium {
  background: #fef3c7;
  color: #92400e;
}
.difficulty-hard {
  background: #fee2e2;
  color: #991b1b;
}
.difficulty-easy-badge {
  background: #d1fae5;
  color: #065f46;
}
.difficulty-medium-badge {
  background: #fef3c7;
  color: #92400e;
}
.difficulty-hard-badge {
  background: #fee2e2;
  color: #991b1b;
}

.price-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* ============== Output Images ============== */
.output-images-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 10px;
}
.output-images-section .section-label {
  margin-bottom: 8px;
}
.output-images-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.output-thumbnail {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}
.output-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.output-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.output-thumbnail .output-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(16, 185, 129, 0.9);
  color: white;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 3px 0;
}

/* ============== Buttons ============== */
.btn-download {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  width: 100%;
}
.btn-download:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}
.btn-upload {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn-upload:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}
.btn-upload:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-reject {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}
.btn-reject:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}
.form-buttons {
  display: flex;
  gap: 10px;
}
.form-buttons .btn-upload,
.form-buttons .btn-reject {
  flex: 1;
}

/* ============== Upload Form ============== */
.upload-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}
.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.upload-header > label {
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-700);
  margin: 0;
}
.file-input-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.file-input-inline input[type='file'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.file-input-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500 !important;
  font-size: 12px !important;
  transition: var(--transition);
  white-space: nowrap;
}
.file-input-btn:hover {
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
  border-color: var(--gray-400);
}
.file-name {
  font-size: 12px;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.file-name.has-file {
  color: var(--success);
  font-weight: 500;
}

/* ============== Image Modal ============== */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.image-modal.active {
  display: flex;
}
.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-lg);
}
.image-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  transition: var(--transition);
}
.image-modal-close:hover {
  color: var(--danger-light);
}

/* ============== Statistics Modal ============== */
.stats-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.stats-modal.active {
  display: flex;
}
.stats-modal-content {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}
.stats-modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.stats-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.stats-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Stats Filters */
.stats-filters {
  padding: 16px 24px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stats-filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.stats-filter-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}
.stats-filter-row select {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  font-size: 13px;
  background: white;
  font-family: inherit;
  cursor: pointer;
}
.stats-filter-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}
.stats-filter-row--hidden {
  display: none;
}
.stats-filter-group--hidden {
  display: none;
}
.stats-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stats-filters label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}
.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-range-inputs input[type='date'] {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  font-size: 13px;
  background: white;
  font-family: inherit;
}
.date-range-inputs input[type='date']:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.1);
}
.date-separator {
  font-size: 12px;
  color: var(--gray-500);
}
.date-apply-btn {
  padding: 6px 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: var(--transition);
}
.date-apply-btn:hover {
  background: var(--accent-dark);
}
.date-clear-btn {
  padding: 6px 10px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.date-clear-btn:hover {
  background: var(--gray-200);
}

/* Stats Loading/Error */
.stats-loading,
.stats-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--gray-500);
  gap: 16px;
}
.stats-loading .loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Stats Tabs */
.stats-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}
.stats-tab {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.stats-tab:hover {
  color: var(--gray-700);
  background: var(--gray-50);
}
.stats-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.stats-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.stat-card .stat-sublabel {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 6px;
  font-weight: 500;
}
.stat-card.earnings .stat-value {
  color: var(--success);
}

/* Payment Summary */
.payment-summary {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border-radius: var(--radius-lg);
  border: 1px solid #fde047;
}
.payment-summary h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0 0 16px 0;
}
.payment-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.payment-card {
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
}
.payment-card.unpaid {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border: 1px solid #fca5a5;
}
.payment-card.paid {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 1px solid #6ee7b7;
}
.payment-card .payment-value {
  font-size: 28px;
  font-weight: 700;
}
.payment-card.unpaid .payment-value {
  color: #b91c1c;
}
.payment-card.paid .payment-value {
  color: #047857;
}
.payment-card .payment-label {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}
.payment-card.unpaid .payment-label {
  color: #991b1b;
}
.payment-card.paid .payment-label {
  color: #065f46;
}
.payment-card .payment-count {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.8;
}

/* Activity Chart */
.full-width-chart {
  margin-top: 24px;
}
.chart-container {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
}
.chart-container h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0 0 16px 0;
}
.chart-container canvas {
  max-height: 260px;
}

/* ============== Stats Tables ============== */
.stats-instances-section {
  margin-top: 24px;
}
.stats-instances-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0 0 12px 0;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table th {
  background: var(--gray-100);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-300);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.stats-table tr:hover {
  background: var(--gray-50);
}
.stats-table .sku-cell {
  font-family: monospace;
  font-size: 11px;
  color: var(--gray-600);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-table-wrapper {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}
.stats-empty-table {
  padding: 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

/* Payments Tab */
.payment-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.payment-total-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.payment-total-card.paid {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 1px solid #6ee7b7;
}
.payment-total-card.unpaid {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border: 1px solid #fca5a5;
}
.payment-total-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.payment-total-card.paid .payment-total-label {
  color: #065f46;
}
.payment-total-card.unpaid .payment-total-label {
  color: #991b1b;
}
.payment-total-value {
  font-size: 32px;
  font-weight: 700;
}
.payment-total-card.paid .payment-total-value {
  color: #047857;
}
.payment-total-card.unpaid .payment-total-value {
  color: #b91c1c;
}

/* Payment Row Styles */
.payment-row-paid td:first-child {
  border-left: none;
}
.payment-row-unpaid td:first-child {
  border-left: none;
}

.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.payment-status.status-paid {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #6ee7b7;
}
.payment-status.status-unpaid {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ============== Toast (override common for bottom placement) ============== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}
.toast.success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.toast.error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.toast.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}
@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============== Bulk Upload Modal ============== */
.bulk-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.bulk-modal.active {
  display: flex;
}
.bulk-modal-content {
  background: white;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.bulk-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.bulk-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--gray-800);
}
.bulk-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-500);
}
.bulk-modal-body {
  padding: 20px;
}
.bulk-instructions {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.bulk-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.bulk-upload-area:hover {
  border-color: var(--accent);
  background: rgba(8, 145, 178, 0.05);
}
.bulk-drop-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}
.bulk-drop-text {
  color: var(--gray-600);
  font-size: 14px;
  display: block;
}
.bulk-file-name {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.bulk-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}
.bulk-modal-actions .secondary-btn {
  padding: 10px 20px;
  border: 1px solid var(--gray-300);
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-600);
  transition: var(--transition);
}
.bulk-modal-actions .secondary-btn:hover {
  background: var(--gray-100);
}
.bulk-modal-actions .primary-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.bulk-modal-actions .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}
.bulk-modal-actions .primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============== Error Results Modal ============== */
#errorResultsModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
#errorResultsModal.active {
  display: flex;
}
.error-modal-content {
  background: white;
  border-radius: var(--radius-xl);
  width: 500px;
  max-width: 90vw;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.error-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-bottom: 1px solid #fca5a5;
}
.error-modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #991b1b;
}
.error-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #991b1b;
}
.error-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.error-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fef2f2;
  border-radius: var(--radius-md);
  border-left: 3px solid #ef4444;
}
.error-file {
  font-weight: 500;
  color: var(--gray-800);
  font-size: 13px;
}
.error-reason {
  font-size: 12px;
  color: #991b1b;
  text-align: right;
}

/* ============== Responsive ============== */
@media (max-width: 1200px) {
  .edition-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .designer-body {
    flex-direction: column;
    height: auto;
  }
  .sidebar {
    width: 100%;
    min-width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }
  .detail-panel {
    min-height: 60vh;
  }
  .header-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .detail-header-meta {
    flex-wrap: wrap;
  }
}

/* ─── Modern Edition Cards ─── */
.edition-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: var(--transition);
}
.edition-card:hover {
  box-shadow: var(--shadow-sm);
}
.edition-card--instructions {
  border-left: none;
}
.edition-card--instructions.edition-card--muted {
  border-left: none;
}
.edition-card--actions {
  border-left: none;
}
.edition-card--submission {
  border-left: none;
}
.edition-card--info {
  border-left: none;
}
.edition-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.edition-card-icon {
  font-size: 14px;
}
.edition-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Modern Action Buttons ─── */
.btn-action-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  border: none;
  width: 100%;
}
.btn-action-modern--download {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-action-modern--download:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}
.btn-action-modern--submit {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  flex: 1;
}
.btn-action-modern--submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}
.btn-action-modern--reject {
  background: white;
  color: #dc2626;
  border: 1px solid #fca5a5;
  flex: 1;
}
.btn-action-modern--reject:hover {
  background: #fef2f2;
  border-color: #ef4444;
}
.btn-action-icon {
  font-size: 14px;
}

/* ─── Modern Upload Form ─── */
.upload-form-modern {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.file-input-modern {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--gray-50);
  transition: var(--transition);
  font-size: 13px;
  color: var(--gray-500);
}
.file-input-modern:hover {
  border-color: var(--accent);
  background: rgba(8, 145, 178, 0.03);
}
.file-input-modern input[type='file'] {
  display: none;
}
.file-input-modern-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.file-input-modern-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-input-modern-text.has-file {
  color: var(--success);
  font-weight: 600;
}
.upload-actions-modern {
  display: flex;
  gap: 8px;
}

/* ─── Reference Images Card (left column) ─── */
.detail-ref-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border-left: 3px solid #8b5cf6;
}
.detail-ref-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.detail-ref-card-icon {
  font-size: 14px;
}
.detail-ref-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-ref-card-count {
  background: #8b5cf6;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.detail-ref-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-ref-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  border: 2px solid transparent;
}
.detail-ref-thumb:hover {
  transform: scale(1.05);
  border-color: #8b5cf6;
}
.detail-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-ref-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(139, 92, 246, 0.85);
  color: white;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
}

/* ─── Info Tags ─── */
.info-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  background: var(--gray-50);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

/* ─── Stats Section Header (with PDF button) ─── */
.stats-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stats-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}
.btn-pdf-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-pdf-download:hover {
  background: var(--gray-50);
  border-color: var(--accent);
  color: var(--accent);
}
