/* ── Upload Page ─────────────────────────────────────────────────────────── */

.upl-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

/* ── Left column ── */
.upl-left-col { display: flex; flex-direction: column; }

.upl-drop-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(15,35,61,0.07);
  padding: 28px;
}

.upl-drop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.upl-drop-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.upl-drop-sub {
  font-size: 12.5px;
  color: #64748b;
  margin: 0;
}

.upl-fmt-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.upl-fmt-chips span {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  background: #fff;
  letter-spacing: 0.3px;
}

.upl-drop-zone {
  border: 2px dashed #c8d8e8;
  border-radius: 14px;
  background: #f8fbff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  gap: 6px;
  min-height: 280px;
}

.upl-drop-zone:hover, .upl-drop-zone.drag {
  border-color: #22c55e;
  background: #f0fdf4;
}

.upl-drop-icon-wrap {
  width: 68px;
  height: 68px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15,35,61,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.upl-drop-icon { width: 28px; height: 28px; stroke: #64748b; }

.upl-drop-h {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.upl-drop-p {
  font-size: 13px;
  color: #64748b;
  margin: 2px 0 0;
}

.upl-drop-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin: 0;
}

.upl-select-btn {
  margin-top: 14px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.upl-select-btn:hover { background: #15803d; }

/* Drop zone: file selected state */
.upl-drop-zone.has-file {
  border-color: #22c55e;
  background: #f0fdf4;
  cursor: default;
}

.upl-drop-file-icon {
  width: 64px;
  height: 64px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15,35,61,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.upl-drop-file-icon svg { stroke: #16a34a; }

.upl-drop-file-ext {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #16a34a;
  background: #dcfce7;
  border-radius: 5px;
  padding: 2px 8px;
  margin-bottom: 10px;
}

.upl-drop-file-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.upl-drop-file-size {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 4px;
}

.upl-drop-change-btn {
  margin-top: 14px;
  background: #fff;
  border: 1.5px solid #22c55e;
  border-radius: 8px;
  color: #16a34a;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.upl-drop-change-btn:hover { background: #f0fdf4; }

/* ── Selected files area ── */
.upl-selected {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

.upl-selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.upl-clear-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  color: #64748b;
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
}
.upl-clear-btn:hover { background: #f8fafc; }

.upl-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.upl-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  color: #475569;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upl-upload-btn {
  margin-top: 16px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.upl-upload-btn:hover { background: #15803d; }
.upl-upload-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── Progress left (file info + CAD preview) ── */
.upl-progress-left {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(15,35,61,0.07);
  padding: 28px;
  display: none;
  flex-direction: row;
  gap: 28px;
  align-items: center;
  min-height: 320px;
}

.upl-progress-left-inner {
  display: flex;
  gap: 28px;
  align-items: center;
  width: 100%;
}

.upl-cad-preview-area {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.upl-cad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  animation: uplPulse 2s ease-in-out infinite;
}

@keyframes uplPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.upl-cad-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upl-file-meta { flex: 1; }

.upl-file-name {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  word-break: break-all;
}

.upl-file-stats {
  font-size: 13px;
  color: #64748b;
}

/* ── Right column ── */
.upl-right-col { display: flex; flex-direction: column; gap: 14px; }

/* Workflow card */
.upl-workflow-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(15,35,61,0.07);
  padding: 22px 24px;
}

.upl-workflow-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
}

.upl-wf-steps { display: flex; flex-direction: column; gap: 14px; }

.upl-wf-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.upl-wf-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  color: #16a34a;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upl-wf-label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.upl-wf-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 1px;
}

/* Pro tip */
.upl-pro-tip {
  background: #0f1e33;
  border-radius: 14px;
  padding: 20px 22px;
  color: #e2e8f0;
}

.upl-pro-tip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.upl-pro-tip p {
  font-size: 13px;
  color: #cbd5e1;
  margin: 0 0 12px;
  line-height: 1.55;
}

.upl-pro-tip strong { color: #fff; }

.upl-pro-tip-link {
  font-size: 12.5px;
  color: #22c55e;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.upl-pro-tip-link:hover { text-decoration: underline; }

/* ── Step progress cards ── */
.upl-step-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: background 0.2s, border-color 0.2s;
}

.upl-step-pending .upl-step-icon { background: #f1f5f9; }
.upl-step-pending .upl-step-icon svg { stroke: #94a3b8; }
.upl-step-pending .upl-step-name { color: #94a3b8; }
.upl-step-pending .upl-step-hint { color: #cbd5e1; }
.upl-step-pending .upl-step-pct { color: #94a3b8; }
.upl-step-pending .upl-step-bar { background: #e2e8f0; width: 0 !important; }

.upl-step-active {
  background: #f0fdf4;
  border-color: #86efac;
}
.upl-step-active .upl-step-icon { background: #dcfce7; }
.upl-step-active .upl-step-icon svg { stroke: #16a34a; }
.upl-step-active .upl-step-name { color: #15803d; font-weight: 700; }
.upl-step-active .upl-step-hint { color: #4ade80; }
.upl-step-active .upl-step-pct { color: #16a34a; font-weight: 700; }

.upl-step-done {
  background: #fff;
  border-color: #bbf7d0;
}
.upl-step-done .upl-step-icon { background: #22c55e; }
.upl-step-done .upl-step-icon svg { stroke: #fff; }
.upl-step-done .upl-step-name { color: #15803d; }
.upl-step-done .upl-step-pct { color: #16a34a; font-weight: 700; }

.upl-step-error { background: #fff1f2; border-color: #fecdd3; }
.upl-step-error .upl-step-icon { background: #fee2e2; }
.upl-step-error .upl-step-icon svg { stroke: #ef4444; }
.upl-step-error .upl-step-name { color: #dc2626; }

.upl-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.upl-step-body { flex: 1; min-width: 0; }

.upl-step-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.upl-step-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

.upl-step-pct {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.upl-step-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.upl-step-bar-wrap {
  height: 5px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

.upl-step-bar {
  height: 100%;
  background: #22c55e;
  border-radius: 99px;
  transition: width 0.5s ease;
  width: 0%;
}

.upl-result-msg {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}
.upl-result-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.upl-result-error   { background: #fff1f2; color: #dc2626; border: 1px solid #fecdd3; }
.upl-result-warn    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.upl-new-btn {
  margin-top: 6px;
  width: 100%;
  background: #fff;
  border: 1.5px solid #22c55e;
  border-radius: 10px;
  color: #16a34a;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.upl-new-btn:hover { background: #f0fdf4; }

/* ── Recent files table ── */
.upl-recent-wrap {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(15,35,61,0.07);
  overflow: hidden;
}

.upl-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.upl-recent-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 7px;
}

.upl-recent-all {
  background: none;
  border: none;
  color: #16a34a;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.upl-recent-all:hover { text-decoration: underline; }

.upl-recent-table-wrap { overflow-x: auto; }

.upl-recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.upl-recent-table thead th {
  padding: 10px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.upl-recent-table tbody td {
  padding: 11px 20px;
  color: #334155;
  border-bottom: 1px solid #f8fafc;
  white-space: nowrap;
}

.upl-recent-table tbody tr:last-child td { border-bottom: none; }
.upl-recent-table tbody tr:hover td { background: #f8fafc; }

.upl-rt-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: #1e293b !important;
}

.upl-rt-status { font-weight: 600; font-size: 12px; }

@media (max-width: 1100px) {
  .upl-grid { grid-template-columns: 1fr; }
  .upl-right-col { flex-direction: row; gap: 14px; }
  .upl-workflow-card, .upl-pro-tip { flex: 1; }
}
