*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* ── Centered white card ─────────────────────────────────── */
.page-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 48px 52px 44px;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Title ───────────────────────────────────────────────── */
h1 {
  margin: 0 0 20px;
  font-size: 1.9rem;
  font-weight: 800;
  color: #0f172a;
}

/* ── Member Profile button ───────────────────────────────── */
.member-profile-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}

.btn-member-profile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 18px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn-member-profile:hover { background: #e2e8f0; border-color: #94a3b8; }

.member-profile-hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ── Hint text ───────────────────────────────────────────── */
.hint {
  color: #64748b;
  font-size: 0.92rem;
  margin: 0 0 16px;
}

/* ── Upload section ──────────────────────────────────────── */
#upload-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#uploadForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Drop zone ───────────────────────────────────────────── */
.dropzone {
  width: 100%;
  border: 2px dashed #94a3b8;
  border-radius: 14px;
  padding: 40px 28px 32px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone.drag { background: #e2e8f0; border-color: #64748b; }

.zip-icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.dropzone-label {
  font-size: 1rem;
  color: #334155;
  font-weight: 500;
}

/* ── Generate button ────────────────────────────────────── */
#generateBtn {
  margin-top: 20px;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  background: #475569;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  max-width: 320px;
}
#generateBtn:hover:not(:disabled) { background: #334155; }
#generateBtn:disabled { background: #94a3b8; cursor: not-allowed; }

#msg {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #334155;
}

/* ── Last-loaded card ────────────────────────────────────── */
.last-loaded-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 24px;
  width: 100%;
  margin-bottom: 24px;
  text-align: left;
}

.last-loaded-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.last-loaded-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.last-loaded-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.last-loaded-id {
  font-size: 0.82rem;
  color: #64748b;
}

.last-loaded-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.btn-view-timeline {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: #334155;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-view-timeline:hover { background: #1e293b; }

.btn-upload-new {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0;
  transition: background 0.15s, border-color 0.15s;
}
.btn-upload-new:hover { background: #f8fafc; border-color: #94a3b8; }

/* ── File queue list ─────────────────────────────────────── */
.file-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  width: 100%;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
}

.file-name {
  flex: 1;
  font-size: 0.85rem;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.file-status {
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.file-status.uploading { color: #3b82f6; }
.file-status.done      { color: #16a34a; }
.file-status.error     { color: #dc2626; }
.file-status.pending   { color: #94a3b8; }

.file-remove {
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 5px;
  line-height: 1;
  margin-top: 0;
}
.file-remove:hover { background: #fee2e2; color: #dc2626; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid #bfdbfe;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

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